Changeset 5747 in orxonox.OLD for branches/network
- Timestamp:
- Nov 23, 2005, 11:32:20 PM (19 years ago)
- Location:
- branches/network/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/network/src/lib/network/data_stream.h
r5728 r5747 13 13 #include "netdefs.h" 14 14 15 #define DATA_STREAM_BUFFER_SIZE 1024 16 15 17 class DataStream : public BaseObject 16 18 { … … 18 20 DataStream(); 19 21 DataStream(DataStream& inStream, DataStream& outStream); 20 21 22 ~DataStream(); 22 23 23 24 24 25 void connectUpStream(DataStream& upStream); … … 37 38 int passUp(byte* data); 38 39 39 byte* upBuffer [ 1024];40 byte* downBuffer [ 1024];40 byte* upBuffer [DATA_STREAM_BUFFER_SIZE]; 41 byte* downBuffer [DATA_STREAM_BUFFER_SIZE]; 41 42 unsigned int bufferSize; 42 43 DataStream* upStream; -
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 } -
branches/network/src/subprojects/network/network_unit_test.cc
r5733 r5747 169 169 //else if(!strcmp( "--gui", argv[i]) || !strcmp("-g", argv[i])) showGui = true; 170 170 if (! strcmp( "--sockettest", argv[i]) || !strcmp("-s", argv[i])) return testSocket(argc, argv); 171 else if (! strcmp( "--frameworktest", argv[i]) || !strcmp("- s", argv[i])) return testFramework(argc, argv);171 else if (! strcmp( "--frameworktest", argv[i]) || !strcmp("-f", argv[i])) return testFramework(argc, argv); 172 172 } 173 173 … … 180 180 bool ShellBuffer::addBufferLineStatic(const char* line, ...) 181 181 { 182 va_list arguments; 183 vprintf(line, arguments); 182 //va_list arguments; 183 //vprintf(line, arguments); 184 printf("%s", line); 184 185 185 186 }
Note: See TracChangeset
for help on using the changeset viewer.