- Timestamp:
- Nov 28, 2005, 6:36:16 PM (19 years ago)
- Location:
- branches/network/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/network/src/lib/network/network_manager.cc
r5804 r5805 139 139 NetworkStream& NetworkManager::createServer(Synchronizeable& sync, unsigned int port) 140 140 { 141 printf("Create a new server socket, liestening on port %u...\n", port);141 PRINTF(0)("Create a new server socket\n"); 142 142 /* creating a new network stream, it will register itself automaticaly to the class list */ 143 143 NetworkStream* netStream = new NetworkStream(sync, port, NET_SERVER); -
branches/network/src/lib/network/network_protocol.cc
r5802 r5805 68 68 return -1; 69 69 70 // for(int i = 0; i < length; i++) 71 // printf("send byte[%i]=%u\n", i, data[i]); 72 70 73 //Create space for the header 71 74 for( int i = length - 1; i >= 0; i--) … … 102 105 h.data = data; 103 106 107 // for(int i = 0; i < length; i++) 108 // printf("recS byte[%i]=%u\n", i, data[i]); 109 104 110 //Remove header 105 111 for (int i = headerLength; i < length; i++) -
branches/network/src/lib/network/network_socket.cc
r5804 r5805 163 163 tcpSocket = NULL; 164 164 SDL_mutexV(socketMutex); 165 166 165 } 167 166 … … 220 219 SDL_mutexV(outgoingBufferMutex); 221 220 221 222 222 return nbytes; 223 223 #else … … 395 395 #undef min 396 396 397 //printf("thread_write nbytes=%d listening=%d\n", nbytestowrite, (int)self->_isListening);397 // printf("thread_write nbytes=%d listening=%d\n", nbytestowrite, (int)self->_isListening); 398 398 399 399 //if buffer is full … … 431 431 } 432 432 433 printf("QUIT WRITE THREAD\n"); 433 434 return 0; 434 435 } -
branches/network/src/lib/network/network_stream.cc
r5804 r5805 86 86 networkSocket->disconnectServer(); 87 87 88 delete networkSocket; 88 if( this->networkSocket) 89 delete networkSocket; 90 89 91 delete connectionMonitor; 90 92 delete networkProtocol; … … 107 109 *(this->synchronizeables), 12); 108 110 109 printf("created header: data packet wights: %i bytes\n", ret);110 111 /* pass the data to the network socket */ 111 112 ret = this->networkSocket->writeBytes((byte*)downBuffer, ret); 112 113 /* check if there was an error */ 113 printf("NetworkSocket: sent %i bytes\n", ret);114 114 if( ret == -1) { PRINTF(0)("Error in writing data to the NetworkSocket\n");} 115 115 … … 122 122 ret = this->networkSocket->readBlock((byte*)upBuffer, 11/* this is very bad: hard coded packet sizes! */); 123 123 /* error checking: data read? */ 124 printf("NetworkSocket: received %i bytes\n", ret);125 124 if( ret != 11 /*PACKAGE_SIZE + sizeof(Header)*/) { PRINTF(0)("Error while reading data from the NetworkSocket. Skipping further work\n");} 126 125 else -
branches/network/src/subprojects/network/network_unit_test.cc
r5804 r5805 143 143 if(error == -1) printf("\n\nerror on address resolution, program inconsistancy\n\n"); 144 144 nm->establishConnection(ip, *clientSync); 145 SDL_Delay(1000); 145 146 146 147 /* synchronize the data 1 time (increment for longer tests) */ 147 for( int i = 0; i < 2; i++) {148 for( int i = 0; i < 3; i++) { 148 149 nm->synchronize(); 150 /* simulate the network delay */ 151 SDL_Delay(50); 149 152 } 150 153 -
branches/network/src/subprojects/network/simple_sync.cc
r5804 r5805 66 66 if(this->inLength < length) 67 67 PRINTF(0)("ERROR: local buffer is smaller than the data to receive.\n"); 68 68 69 /* copy the data localy */ 69 70 for( int i = 0; i < length; i++) … … 82 83 { 83 84 PRINTF(0)("SimpleSync: sent %i bytes of data\n", this->outLength); 85 84 86 /* write the test message */ 85 data = this->outData; 87 for( int i = 0; i < this->outLength; i++) 88 { 89 data[i] = this->outData[i]; 90 } 91 86 92 /* debug msg */ 87 93 this->readDebug(); … … 93 99 void SimpleSync::writeDebug() 94 100 { 95 PRINTF(0)("Write in :|");101 PRINTF(0)("Write in bytes: \t(0 <-) |"); 96 102 for(int i = 0; i < this->recLength; i++) 97 103 { … … 104 110 void SimpleSync::readDebug() 105 111 { 106 PRINTF(0)("Read out bytes: |");112 PRINTF(0)("Read out bytes: \t(0 ->) |"); 107 113 for(int i = 0; i < this->outLength; i++) 108 114 {
Note: See TracChangeset
for help on using the changeset viewer.