Changeset 7774
- Timestamp:
- Dec 17, 2010, 11:49:08 AM (14 years ago)
- Location:
- code/branches/network5/src/libraries/network
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/network5/src/libraries/network/ClientConnection.cc
r7773 r7774 70 70 ENetEvent event; 71 71 72 // create host 72 73 this->host_ = enet_host_create(NULL, NETWORK_CLIENT_MAX_CONNECTIONS, NETWORK_CHANNEL_COUNT, 0, 0); 74 73 75 if ( this->host_ == NULL ) 74 76 { … … 77 79 return false; 78 80 } 81 82 // enable compression 83 this->enableCompression(); 84 79 85 assert( this->host_->socket4 != ENET_SOCKET_NULL || this->host_->socket6 != ENET_SOCKET_NULL ); 80 86 if (this->host_->socket4 == ENET_SOCKET_NULL) -
code/branches/network5/src/libraries/network/Connection.cc
r7772 r7774 210 210 return p->process(); 211 211 } 212 213 void Connection::enableCompression() 214 { 215 enet_host_compress_with_range_coder( this->host_ ); 216 } 217 212 218 213 219 } -
code/branches/network5/src/libraries/network/Connection.h
r7772 r7774 95 95 void communicationThread(); 96 96 virtual void disconnectPeer(ENetPeer *peer); 97 98 void enableCompression(); 97 99 98 100 void processQueue(); -
code/branches/network5/src/libraries/network/ServerConnection.cc
r7773 r7774 68 68 bool ServerConnection::openListener() 69 69 { 70 // create host 70 71 this->host_ = enet_host_create(this->bindAddress_, NETWORK_MAX_CONNECTIONS, NETWORK_CHANNEL_COUNT, 0, 0); 72 71 73 if ( this->host_ == NULL ) 72 74 { … … 74 76 return false; 75 77 } 78 79 // enable compression 80 this->enableCompression(); 76 81 assert( this->host_->socket4 != ENET_SOCKET_NULL || this->host_->socket6 != ENET_SOCKET_NULL ); 77 82 if (this->host_->socket4 == ENET_SOCKET_NULL) … … 82 87 COUT(3) << "Info: Using IPv4 and IPv6 Sockets." << std::endl; 83 88 89 // start communication thread 84 90 Connection::startCommunicationThread(); 85 91
Note: See TracChangeset
for help on using the changeset viewer.