sources/network/udpsocket.h

branch
protocol5
changeset 159
970d58a01e8b
parent 158
de7574d292ad
child 183
9b6a0daedfc0
equal deleted inserted replaced
155:9f71f854474a 159:970d58a01e8b
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 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 Bytestream& 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