source:
orxonox.OLD/trunk/src/lib/network/network_stream.h
@
5975
Last change on this file since 5975 was 5822, checked in by bensch, 19 years ago | |
---|---|
File size: 1.3 KB |
Rev | Line | |
---|---|---|
[5566] | 1 | /*! |
2 | * @file network_stream.h | |
3 | * implementation of a network pipe | |
4 | */ | |
[5587] | 5 | |
[5566] | 6 | #ifndef _NETWORK_STREAM |
7 | #define _NETWORK_STREAM | |
8 | ||
[5582] | 9 | #include "data_stream.h" |
[5809] | 10 | #include "network_protocol.h" |
[5566] | 11 | |
[5647] | 12 | class Synchronizeable; |
13 | class NetworkSocket; | |
14 | class ConnectionMonitor; | |
[5741] | 15 | class NetworkProtocol; |
[5589] | 16 | |
[5809] | 17 | |
18 | //<! The state of the NetworkStream | |
19 | typedef enum NetStat { | |
20 | NET_REC_HEADER = 0, //!< Waiting for header | |
21 | NET_REC_DATA, //!< Waiting for data | |
22 | ||
23 | NUM_STATES //!< Number of states | |
24 | }; | |
25 | ||
26 | ||
[5649] | 27 | class NetworkStream : public DataStream |
[5566] | 28 | { |
29 | ||
30 | public: | |
31 | NetworkStream(); | |
[5649] | 32 | NetworkStream(IPaddress& address, Synchronizeable& sync, NodeType type); |
[5811] | 33 | NetworkStream(unsigned int port, Synchronizeable& sync, NodeType type); |
[5566] | 34 | ~NetworkStream(); |
[5804] | 35 | |
[5647] | 36 | void init(); |
[5804] | 37 | |
[5798] | 38 | inline bool isServer() { return (this->type == NET_SERVER)? true:false; } |
[5647] | 39 | virtual void processData(); |
[5566] | 40 | |
[5583] | 41 | private: |
[5741] | 42 | NetworkProtocol* networkProtocol; |
[5804] | 43 | //NetworkSocket* networkSockets; |
[5741] | 44 | ConnectionMonitor* connectionMonitor; |
45 | // tList<Synchronizeable>* synchronizeables; | |
[5804] | 46 | Synchronizeable* synchronizeables; |
[5741] | 47 | NetworkSocket* networkSocket; |
[5798] | 48 | int type; |
[5809] | 49 | int state; |
50 | Header packetHeader; | |
[5587] | 51 | }; |
[5566] | 52 | #endif /* _NETWORK_STREAM */ |
53 |
Note: See TracBrowser
for help on using the repository browser.