sources/network/udpsocket.h

changeset 158
de7574d292ad
parent 157
42bb29924218
child 183
9b6a0daedfc0
equal deleted inserted replaced
157:42bb29924218 158:de7574d292ad
36 36
37 enum { MAX_DATAGRAM_LENGTH = 5120 }; 37 enum { MAX_DATAGRAM_LENGTH = 5120 };
38 38
39 struct Datagram 39 struct Datagram
40 { 40 {
41 Vector<unsigned char> message; 41 ByteArray message;
42 IPAddress address; 42 IPAddress address;
43 }; 43 };
44 44
45 // ------------------------------------------------------------------------------------------------- 45 // -------------------------------------------------------------------------------------------------
46 // 46 //
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 Vector<unsigned char>& data); 55 bool send (const IPAddress& address, const ByteArray& data);
56 bool set_blocking (bool a); 56 bool set_blocking (bool a);
57 const String& error_string() const { return m_error; } 57 const 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