Changeset 5747 in orxonox.OLD for branches/network/src/lib/network/network_stream.cc
- Timestamp:
- Nov 23, 2005, 11:32:20 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/network/src/lib/network/network_stream.cc
r5746 r5747 19 19 */ 20 20 #define DEBUG_MODULE_NETWORK 21 #define PACKAGE_SIZE 256 21 22 22 23 23 #include "base_object.h" … … 35 35 using namespace std; 36 36 37 38 #define PACKAGE_SIZE 256 37 39 38 40 … … 102 104 103 105 /* send the received data to connectionMonitor */ 104 this->connectionMonitor->processPacket((byte*)downBuffer, PACKAGE_SIZE);106 this->connectionMonitor->processPacket((byte*)downBuffer, ret + sizeof(Header)); 105 107 106 this->networkProtocol->createHeader((byte*) downBuffer , PACKAGE_SIZE , 1024,*(this->synchronizeables),12); 108 this->networkProtocol->createHeader((byte*)downBuffer, ret, DATA_STREAM_BUFFER_SIZE, 109 *(this->synchronizeables), 12); 107 110 108 111 /* pass the data to the network socket */ … … 119 122 /* first of all read data from networkSocket*/ 120 123 while(ret == 0) 121 ret = this->networkSocket->readBlock((byte*)upBuffer, PACKAGE_SIZE + sizeof(Header));124 ret = this->networkSocket->readBlock((byte*)upBuffer, PACKAGE_SIZE + sizeof(Header)); 122 125 /* error checking: data read? */ 123 if( ret != PACKAGE_SIZE ) { PRINTF(0)("Error while reading data from the NetworkSocket\n");}126 if( ret != PACKAGE_SIZE + sizeof(Header)) { PRINTF(0)("Error while reading data from the NetworkSocket\n");} 124 127 125 128 /* send the received data to connectionMonitor */ … … 130 133 131 134 /* now pass the data to the sync object */ 132 this->synchronizeables->writeBytes((byte*)upBuffer [sizeof(Header)], PACKAGE_SIZE);135 this->synchronizeables->writeBytes((byte*)upBuffer, PACKAGE_SIZE); 133 136 134 137 }
Note: See TracChangeset
for help on using the changeset viewer.