ServerConnection.h
Go to the documentation of this file.00001 00010 #ifndef __ServerConnection_H__ 00011 #define __ServerConnection_H__ 00012 00013 // Includes 00014 00015 // Forward declares 00016 class StaticBuffer; 00017 class DynamicBuffer; 00018 00019 // ServerConnection 00020 class ServerConnection 00021 { 00022 public: 00023 00027 ServerConnection(); 00028 00029 00033 virtual ~ServerConnection(); 00034 00035 00040 void Connect( 00041 int port, 00042 bool useTCP, 00043 bool useUDP 00044 ); 00045 00046 00052 void ConnectSP(); 00053 00054 00058 void Disconnect(); 00059 00060 00064 void Update(float deltaTime); 00065 00066 00073 void TransmitTCP( 00074 int clientId, 00075 const StaticBuffer& data 00076 ); 00077 00084 void TransmitTCP( 00085 const StaticBuffer& data 00086 ); 00087 00088 00096 void TransmitUDP( 00097 int clientId, 00098 const StaticBuffer& data 00099 ); 00100 00101 00109 void TransmitUDP( 00110 const StaticBuffer& data 00111 ); 00112 00113 00119 virtual void OnClientConnected( 00120 int clientId 00121 ) = 0; 00122 00123 00129 virtual void OnClientDisconnected( 00130 int clientId 00131 ) = 0; 00132 00138 virtual void OnReceiveData( 00139 int clientId, 00140 const StaticBuffer& data 00141 ) = 0; 00142 00143 00144 private: 00145 bool localCommunications_; 00146 bool localCommunications_OnConnected_Done_; 00147 00148 private: 00149 friend class ClientConnection; 00150 static DynamicBuffer* localServerCommunicationsBuffer_; 00151 static int localServerCommunicationsBuffer_referenceCount_; 00152 }; 00153 00154 00155 #endif /* __ServerConnection_H__ */ 00156
Reproduction/republishing of any material on this site without permission is strictly prohibited.
