Changeset 9463 in orxonox.OLD for branches/proxy/src/lib/network/network_stream.cc
- Timestamp:
- Jul 25, 2006, 7:29:31 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/proxy/src/lib/network/network_stream.cc
r9462 r9463 112 112 /* set the class id for the base object */ 113 113 this->setClassID(CL_NETWORK_STREAM, "NetworkStream"); 114 this->serverSocket = NULL; 114 this->clientSocket = NULL; 115 this->proxySocket = NULL; 115 116 this->networkGameManager = NULL; 116 117 this->networkMonitor = NULL; … … 140 141 NetworkStream::~NetworkStream() 141 142 { 142 if ( this->serverSocket ) 143 { 144 serverSocket->close(); 145 delete serverSocket; 146 serverSocket = NULL; 143 if ( this->clientSocket ) 144 { 145 clientSocket->close(); 146 delete clientSocket; 147 clientSocket = NULL; 148 } 149 if ( this->proxySocket) 150 { 151 proxySocket->close(); 152 delete proxySocket; 153 proxySocket = NULL; 147 154 } 148 155 for ( PeerList::iterator i = peers.begin(); i!=peers.end(); i++) … … 219 226 * @param port: interface port for all clients 220 227 */ 221 void NetworkStream::createServer(int port) 222 { 223 this->serverSocket = new UdpServerSocket(port); 228 void NetworkStream::createServer(int clientPort, int proxyPort) 229 { 230 this->proxySocket = new UdpServerSocket(clientPort); 231 this->clientSocket= new UdpServerSocket(proxyPort); 224 232 } 225 233 … … 308 316 { 309 317 // execute everytthing the master server shoudl do 310 if ( serverSocket )311 serverSocket->update();318 if ( clientSocket ) 319 clientSocket->update(); 312 320 313 321 this->updateConnectionList(); … … 316 324 { 317 325 // execute everything the proxy server should do 318 if ( serverSocket )319 serverSocket->update();326 if ( clientSocket ) 327 clientSocket->update(); 320 328 321 329 this->updateConnectionList(); … … 360 368 //check for new connections 361 369 362 NetworkSocket* tempNetworkSocket = serverSocket->getNewSocket();370 NetworkSocket* tempNetworkSocket = clientSocket->getNewSocket(); 363 371 364 372 // we got new network node
Note: See TracChangeset
for help on using the changeset viewer.