Last change
on this file since 5565 was
5565,
checked in by hdavid, 18 years ago
|
orxonox/branches/network: updated network_socket.h and network_socket.cc
|
File size:
747 bytes
|
Line | |
---|
1 | /*! |
---|
2 | * @file network_socket.h |
---|
3 | * Main interface for the network module. Manages all the modules |
---|
4 | |
---|
5 | */ |
---|
6 | |
---|
7 | #ifndef _NETWORK_SOCKET |
---|
8 | #define _NETWORK_SOCKET |
---|
9 | |
---|
10 | /* include this file, it contains some default definitions */ |
---|
11 | #include "netdefs.h" |
---|
12 | |
---|
13 | /* include SDL_net header */ |
---|
14 | #include "SDL_net.h" |
---|
15 | |
---|
16 | /* using namespace std is default, this needs to be here */ |
---|
17 | using namespace std; |
---|
18 | |
---|
19 | class NetworkSocket |
---|
20 | { |
---|
21 | |
---|
22 | private: |
---|
23 | IPaddress serverAddress; |
---|
24 | unsigned int port; |
---|
25 | TCPsocket tcpSocket; |
---|
26 | UDPsocket udpSocket; |
---|
27 | |
---|
28 | public: |
---|
29 | |
---|
30 | NetworkSocket(); |
---|
31 | ~NetworkSocket(); |
---|
32 | |
---|
33 | void connectToServer(IPaddress ip, unsigned int port); |
---|
34 | void listen(unsigned int port); |
---|
35 | void disconnectServer(); |
---|
36 | void writeBytes(byte* data); |
---|
37 | byte* readBytes(); |
---|
38 | |
---|
39 | }; |
---|
40 | |
---|
41 | |
---|
42 | |
---|
43 | #endif /* _NETWORK_SOCKET */ |
---|
Note: See
TracBrowser
for help on using the repository browser.