Changeset 5798 in orxonox.OLD for branches/network/src/subprojects
- Timestamp:
- Nov 27, 2005, 5:52:32 PM (19 years ago)
- Location:
- branches/network/src/subprojects/network
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/network/src/subprojects/network/network_unit_test.cc
r5747 r5798 144 144 145 145 /* synchronize the data 1 time (increment for longer tests) */ 146 for( int i = 0; i < 1; i++) {146 for( int i = 0; i < 3; i++) { 147 147 nm->synchronize(); 148 148 } 149 149 150 printf("Test finished\n"); 151 152 150 153 /* delete the network manager again */ 151 154 delete nm; -
branches/network/src/subprojects/network/simple_sync.cc
r5650 r5798 31 31 { 32 32 this->outLength = 10; 33 this->inLength = 0;33 this->inLength = 40; 34 34 this->outData = new byte[this->outLength]; 35 this->inData = new byte[this->inLength]; 35 36 36 37 for( int i = 0; i < this->outLength; i++) … … 48 49 49 50 /** 50 * write data to NetworkStream51 * write data to Synchronizeable 51 52 */ 52 53 void SimpleSync::writeBytes(byte* data, int length) 53 54 { 55 if(this->inLength < length) 56 PRINTF(0)("ERROR: local buffer is smaller than the data to receive.\n"); 54 57 /* copy the data localy */ 55 this->inLength = length; 56 for(int i = 0; i < length; i++) 58 for( int i = 0; i < this->inLength; i++) 57 59 { 58 60 this->inData[i] = data[i]; … … 64 66 65 67 /** 66 * read data from NetworkStream68 * read data from Synchronizeable 67 69 */ 68 70 int SimpleSync::readBytes(byte* data) … … 79 81 { 80 82 PRINTF(0)("Write in: |"); 81 for(int i = 0; i < inLength; i++)83 for(int i = 0; i < this->inLength; i++) 82 84 { 83 85 PRINT(0)(" %i ",this->inData[i]); … … 89 91 { 90 92 PRINTF(0)("Read out: |"); 91 for(int i = 0; i < outLength; i++)93 for(int i = 0; i < this->outLength; i++) 92 94 { 93 95 PRINT(0)(" %i ",this->outData[i]);
Note: See TracChangeset
for help on using the changeset viewer.