Thu, 11 Dec 2014 07:18:11 +0200
- added huffman lib, now capable of initializing an rcon connection!
5 | 1 | #pragma once |
2 | #include "../main.h" | |
3 | #include "ipaddress.h" | |
4 | #include "bytestream.h" | |
5 | ||
6 | enum { MAX_DATAGRAM_LENGTH = 5120 }; | |
7 | ||
8 | struct Datagram | |
9 | { | |
10 | Bytestream data; | |
11 | IPAddress from; | |
12 | }; | |
13 | ||
14 | // ------------------------------------------------------------------------------------------------- | |
15 | // | |
16 | class UDPSocket | |
17 | { | |
18 | public: | |
19 | UDPSocket(); | |
20 | virtual ~UDPSocket(); | |
21 | ||
22 | METHOD bind (unsigned short port) -> bool; | |
23 | METHOD read (Datagram& datagram) -> bool; | |
8
8b697d30c49f
- added huffman lib, now capable of initializing an rcon connection!
Teemu Piippo <crimsondusk64@gmail.com>
parents:
6
diff
changeset
|
24 | METHOD send (const IPAddress& address, const Bytestream& data) -> bool; |
5 | 25 | METHOD set_blocking (bool a) -> bool; |
26 | ||
27 | private: | |
28 | IPAddress m_addr; | |
29 | String m_error; | |
30 | int m_socket; | |
31 | }; |