Last change
on this file since 5614 was
5614,
checked in by rennerc, 18 years ago
|
network_socket: changed argument types
|
File size:
852 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 | |
---|
14 | /* include base_object.h since all classes are derived from this one */ |
---|
15 | #include "base_object.h" |
---|
16 | |
---|
17 | /* using namespace std is default, this needs to be here */ |
---|
18 | using namespace std; |
---|
19 | |
---|
20 | class NetworkSocket : public BaseObject |
---|
21 | { |
---|
22 | |
---|
23 | private: |
---|
24 | IPaddress serverAddress; |
---|
25 | unsigned int port; |
---|
26 | TCPsocket tcpSocket; |
---|
27 | UDPsocket udpSocket; |
---|
28 | |
---|
29 | public: |
---|
30 | |
---|
31 | NetworkSocket(); |
---|
32 | ~NetworkSocket(); |
---|
33 | |
---|
34 | void connectToServer(IPaddress ip, unsigned int port); |
---|
35 | void listen(unsigned int port); |
---|
36 | void disconnectServer(); |
---|
37 | int writeBytes(byte * data, int length); |
---|
38 | int readBytes(byte * data, int length); |
---|
39 | |
---|
40 | }; |
---|
41 | |
---|
42 | |
---|
43 | |
---|
44 | #endif /* _NETWORK_SOCKET */ |
---|
Note: See
TracBrowser
for help on using the repository browser.