Rev | Line | |
---|
[9252] | 1 | /*! |
---|
| 2 | * @file peer_info.h |
---|
| 3 | * implementation a peer info |
---|
| 4 | */ |
---|
| 5 | |
---|
| 6 | #ifndef _PEER_INFO_H |
---|
| 7 | #define _PEER_INFO_H |
---|
| 8 | |
---|
| 9 | #include "server_socket.h" |
---|
| 10 | #include "handshake.h" |
---|
[9275] | 11 | #include "monitor/connection_monitor.h" |
---|
[9252] | 12 | |
---|
[9286] | 13 | #include <string> |
---|
[9252] | 14 | |
---|
| 15 | //!< this structure contains informations about the network node |
---|
| 16 | class PeerInfo |
---|
| 17 | { |
---|
| 18 | public: |
---|
| 19 | PeerInfo(); |
---|
| 20 | |
---|
| 21 | void clear(); |
---|
| 22 | |
---|
| 23 | |
---|
[9282] | 24 | inline bool isMasterServer() { return this->nodeType == NET_MASTER_SERVER; } |
---|
| 25 | inline bool isProxyServer() { return this->nodeType == NET_PROXY_SERVER; } |
---|
| 26 | inline bool isClient() { return this->nodeType == NET_CLIENT; } |
---|
| 27 | |
---|
[9286] | 28 | std::string getNodeTypeString(); |
---|
[9282] | 29 | |
---|
[9286] | 30 | |
---|
[9252] | 31 | public: |
---|
| 32 | int userId; |
---|
| 33 | int nodeType; |
---|
[9290] | 34 | IPaddress ip; |
---|
| 35 | |
---|
[9252] | 36 | NetworkSocket * socket; |
---|
| 37 | Handshake * handshake; |
---|
| 38 | ConnectionMonitor * connectionMonitor; |
---|
[9290] | 39 | |
---|
[9252] | 40 | int lastAckedState; |
---|
| 41 | int lastRecvedState; |
---|
| 42 | }; |
---|
| 43 | |
---|
| 44 | |
---|
| 45 | |
---|
| 46 | #endif /* _PEER_INFO_H */ |
---|
Note: See
TracBrowser
for help on using the repository browser.