47 { |
48 { |
48 public: |
49 public: |
49 UDPSocket(); |
50 UDPSocket(); |
50 virtual ~UDPSocket(); |
51 virtual ~UDPSocket(); |
51 |
52 |
52 METHOD bind (unsigned short port) -> bool; |
53 bool bind (unsigned short port); |
53 METHOD read (Datagram& datagram) -> bool; |
54 bool read (Datagram& datagram); |
54 METHOD send (const IPAddress& address, const Bytestream& data) -> bool; |
55 bool send (const IPAddress& address, const Bytestream& data); |
55 METHOD set_blocking (bool a) -> bool; |
56 bool set_blocking (bool a); |
56 inline METHOD error_string() -> const String&; |
57 const String& error_string() const { return m_error; } |
57 inline METHOD file_descriptor() -> int; |
58 int file_descriptor() const { return m_socket; } |
58 |
59 |
59 private: |
60 private: |
|
61 static char HuffmanBuffer[131072]; |
|
62 |
60 IPAddress m_addr; |
63 IPAddress m_addr; |
61 String m_error; |
64 String m_error; |
62 int m_socket; |
65 int m_socket; |
63 }; |
66 }; |
64 |
67 |
65 // ------------------------------------------------------------------------------------------------- |
68 END_ZFC_NAMESPACE |
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 } |
|