sources/network/udpsocket.h

changeset 186
9330b93d9946
parent 184
afd63357a03d
child 189
248d0b85cbda
equal deleted inserted replaced
185:e83ec58cc458 186:9330b93d9946
37 enum { MAX_DATAGRAM_LENGTH = 5120 }; 37 enum { MAX_DATAGRAM_LENGTH = 5120 };
38 38
39 struct Datagram 39 struct Datagram
40 { 40 {
41 ByteArray message; 41 ByteArray message;
42 IPAddress address; 42 net::ip_address address;
43 }; 43 };
44 44
45 // ------------------------------------------------------------------------------------------------- 45 // -------------------------------------------------------------------------------------------------
46 // 46 //
47 class UDPSocket 47 class UDPSocket
50 UDPSocket(); 50 UDPSocket();
51 virtual ~UDPSocket(); 51 virtual ~UDPSocket();
52 52
53 bool bind (unsigned short port); 53 bool bind (unsigned short port);
54 bool read (Datagram& datagram); 54 bool read (Datagram& datagram);
55 bool send (const IPAddress& address, const ByteArray& data); 55 bool send (const net::ip_address& address, const ByteArray& data);
56 bool set_blocking (bool a); 56 bool set_blocking (bool a);
57 const std::string& error_string() const { return m_error; } 57 const std::string& error_string() const { return m_error; }
58 int file_descriptor() const { return m_socket; } 58 int file_descriptor() const { return m_socket; }
59 59
60 private: 60 private:

mercurial