Changeset View
Changeset View
Standalone View
Standalone View
source/network/NetSession.h
Show All 33 Lines | |||||
*/ | */ | ||||
extern const u32 MAXIMUM_HOST_TIMEOUT; | extern const u32 MAXIMUM_HOST_TIMEOUT; | ||||
class CNetClient; | class CNetClient; | ||||
class CNetServerWorker; | class CNetServerWorker; | ||||
class CNetStatsTable; | class CNetStatsTable; | ||||
typedef struct _ENetHost ENetHost; | |||||
/** | /** | ||||
* @file | * @file | ||||
* Network client/server sessions. | * Network client/server sessions. | ||||
* | * | ||||
* Each session has two classes: CNetClientSession runs on the client, | * Each session has two classes: CNetClientSession runs on the client, | ||||
* and CNetServerSession runs on the server. | * and CNetServerSession runs on the server. | ||||
* A client runs one session at once; a server typically runs many. | * A client runs one session at once; a server typically runs many. | ||||
*/ | */ | ||||
Show All 15 Lines | |||||
class CNetClientSession : public INetSession | class CNetClientSession : public INetSession | ||||
{ | { | ||||
NONCOPYABLE(CNetClientSession); | NONCOPYABLE(CNetClientSession); | ||||
public: | public: | ||||
CNetClientSession(CNetClient& client); | CNetClientSession(CNetClient& client); | ||||
~CNetClientSession(); | ~CNetClientSession(); | ||||
bool Connect(const CStr& server, const u16 port, const bool isLocalClient); | bool Connect(const CStr& server, const u16 port, const bool isLocalClient, ENetHost* enetClient); | ||||
/** | /** | ||||
* Process queued incoming messages. | * Process queued incoming messages. | ||||
*/ | */ | ||||
void Poll(); | void Poll(); | ||||
/** | /** | ||||
* Flush queued outgoing network messages. | * Flush queued outgoing network messages. | ||||
▲ Show 20 Lines • Show All 122 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator