Changeset 5742 in orxonox.OLD for branches/network/src/lib
- Timestamp:
- Nov 23, 2005, 4:19:54 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/network/src/lib/network/network_stream.cc
r5741 r5742 103 103 this->connectionMonitor->processPacket((byte*)downBuffer, PACKAGE_SIZE); 104 104 105 this->networkProtocol->createHeader((byte*) downBuffer , PACKAGE_SIZE , 1024,*(this->synchronizeables),12);105 this->networkProtocol->createHeader((byte*) downBuffer , PACKAGE_SIZE , 1024,*(this->synchronizeables),12); 106 106 107 107 /* pass the data to the network socket */ 108 ret = this->networkSocket->writeBytes((byte*)downBuffer, PACKAGE_SIZE );108 ret = this->networkSocket->writeBytes((byte*)downBuffer, PACKAGE_SIZE + sizeof(Header)); 109 109 /* check if there was an error */ 110 110 if( ret == -1) { PRINTF(0)("Error in writing data to the NetworkSocket\n");} … … 116 116 ret = 0; 117 117 118 while(ret == 0) ret = this->networkSocket->readBlock((byte*)upBuffer,PACKAGE_SIZE); 118 /* first of all read data from networkSocket*/ 119 while(ret == 0) 120 ret = this->networkSocket->readBlock((byte*)upBuffer,PACKAGE_SIZE + sizeof(Header)); 119 121 /* error checking: data read? */ 120 122 if( ret != PACKAGE_SIZE) { PRINTF(0)("Error while reading data from the NetworkSocket\n");} 121 123 122 124 /* send the received data to connectionMonitor */ 123 this->connectionMonitor->processPacket((byte*)upBuffer, PACKAGE_SIZE );125 this->connectionMonitor->processPacket((byte*)upBuffer, PACKAGE_SIZE + sizeof(Header)); 124 126 125 127 /* extract Header */ 126 this->networkProtocol->extractHeader((byte*) upBuffer , PACKAGE_SIZE );128 this->networkProtocol->extractHeader((byte*) upBuffer , PACKAGE_SIZE + sizeof(Header)); 127 129 128 130 /* now pass the data to the sync object */
Note: See TracChangeset
for help on using the changeset viewer.