Changeset 5806 in orxonox.OLD for branches/network
- Timestamp:
- Nov 28, 2005, 6:49:58 PM (19 years ago)
- Location:
- branches/network/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/network/src/lib/network/synchronizeable.cc
r5804 r5806 40 40 \brief write data to NetworkStream 41 41 */ 42 void Synchronizeable::writeBytes( byte* data, int length)42 void Synchronizeable::writeBytes(const byte* data, int length) 43 43 { 44 44 … … 51 51 \brief read data from NetworkStream 52 52 */ 53 int Synchronizeable::readBytes(byte* data) 53 int Synchronizeable::readBytes(byte* data) const 54 54 { 55 55 … … 59 59 } 60 60 61 void Synchronizeable::writeDebug() 61 void Synchronizeable::writeDebug() const 62 62 { 63 63 64 64 } 65 65 66 void Synchronizeable::readDebug() 66 void Synchronizeable::readDebug() const 67 67 { 68 68 -
branches/network/src/lib/network/synchronizeable.h
r5804 r5806 17 17 ~Synchronizeable(); 18 18 19 virtual void writeBytes( byte* data, int length);20 virtual int readBytes(byte* data) ;21 virtual void writeDebug() ;22 virtual void readDebug() ;19 virtual void writeBytes(const byte* data, int length); 20 virtual int readBytes(byte* data) const; 21 virtual void writeDebug() const; 22 virtual void readDebug() const; 23 23 24 inline const char* getName() { return this->name; }24 inline const char* getName() const { return this->name; } 25 25 26 26 private: -
branches/network/src/subprojects/network/network_unit_test.cc
r5805 r5806 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 /* adding some break for connection setup */ 146 SDL_Delay(20); 146 147 147 148 /* synchronize the data 1 time (increment for longer tests) */ -
branches/network/src/subprojects/network/simple_sync.cc
r5805 r5806 60 60 * write data to Synchronizeable 61 61 */ 62 void SimpleSync::writeBytes( byte* data, int length)62 void SimpleSync::writeBytes(const byte* data, int length) 63 63 { 64 64 PRINTF(0)("SimpleSync: got %i bytes of data\n", length); … … 80 80 * read data from Synchronizeable 81 81 */ 82 int SimpleSync::readBytes(byte* data) 82 int SimpleSync::readBytes(byte* data) const 83 83 { 84 84 PRINTF(0)("SimpleSync: sent %i bytes of data\n", this->outLength); 85 85 86 /* debug msg */ 87 this->readDebug(); 88 86 89 /* write the test message */ 87 90 for( int i = 0; i < this->outLength; i++) 88 {89 91 data[i] = this->outData[i]; 90 }91 92 92 /* debug msg */93 this->readDebug();94 93 /* return the length of the test */ 95 94 return this->outLength; … … 97 96 98 97 99 void SimpleSync::writeDebug() 98 void SimpleSync::writeDebug() const 100 99 { 101 100 PRINTF(0)("Write in bytes: \t(0 <-) |"); … … 108 107 109 108 110 void SimpleSync::readDebug() 109 void SimpleSync::readDebug() const 111 110 { 112 111 PRINTF(0)("Read out bytes: \t(0 ->) |"); -
branches/network/src/subprojects/network/simple_sync.h
r5804 r5806 16 16 ~SimpleSync(); 17 17 18 virtual void writeBytes( byte* data, int length);19 virtual int readBytes(byte* data) ;18 virtual void writeBytes(const byte* data, int length); 19 virtual int readBytes(byte* data) const; 20 20 21 21 22 22 private: 23 virtual void writeDebug() ;24 virtual void readDebug() ;23 virtual void writeDebug() const; 24 virtual void readDebug() const; 25 25 26 26
Note: See TracChangeset
for help on using the changeset viewer.