sources/network/udpsocket.h

changeset 10
3874575d924d
parent 9
e7a09ceb4505
child 73
07dda51a7a8e
equal deleted inserted replaced
9:e7a09ceb4505 10:3874575d924d
47 { 47 {
48 public: 48 public:
49 UDPSocket(); 49 UDPSocket();
50 virtual ~UDPSocket(); 50 virtual ~UDPSocket();
51 51
52 METHOD bind (unsigned short port) -> bool; 52 METHOD bind (unsigned short port) -> bool;
53 METHOD read (Datagram& datagram) -> bool; 53 METHOD read (Datagram& datagram) -> bool;
54 METHOD send (const IPAddress& address, const Bytestream& data) -> bool; 54 METHOD send (const IPAddress& address, const Bytestream& data) -> bool;
55 METHOD set_blocking (bool a) -> bool; 55 METHOD set_blocking (bool a) -> bool;
56 inline METHOD error_string() -> const String&;
57 inline METHOD file_descriptor() -> int;
56 58
57 private: 59 private:
58 IPAddress m_addr; 60 IPAddress m_addr;
59 String m_error; 61 String m_error;
60 int m_socket; 62 int m_socket;
61 }; 63 };
64
65 // -------------------------------------------------------------------------------------------------
66 //
67 inline METHOD
68 UDPSocket::file_descriptor() -> int
69 {
70 return m_socket;
71 }
72
73 // -------------------------------------------------------------------------------------------------
74 //
75 inline METHOD
76 UDPSocket::error_string() -> const String&
77 {
78 return m_error;
79 }

mercurial