sources/network/udpsocket.h

changeset 157
42bb29924218
parent 152
6be21be4bea1
child 158
de7574d292ad
equal deleted inserted replaced
156:ce66d7e374bf 157:42bb29924218
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 Bytestream message; 41 Vector<unsigned char> 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 Bytestream& data); 55 bool send (const IPAddress& address, const Vector<unsigned char>& 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