Changeset 5833 in orxonox.OLD for branches/network/src/lib
- Timestamp:
- Nov 30, 2005, 11:09:18 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/network/src/lib/network/network_stream.cc
r5829 r5833 44 44 this->init(); 45 45 /* initialize the references */ 46 this->type = NET_CLIENT; 46 47 this->networkSocket = new NetworkSocket(); 47 48 this->networkProtocol = new NetworkProtocol(); … … 52 53 NetworkStream::NetworkStream(IPaddress& address, NodeType type) 53 54 { 55 this->type = type; 54 56 this->init(); 55 57 this->networkSocket = new NetworkSocket(address); … … 62 64 NetworkStream::NetworkStream(unsigned int port, NodeType type) 63 65 { 66 this->type = type; 64 67 this->init(); 65 68 this->networkSocket = new NetworkSocket(); … … 74 77 : DataStream() 75 78 { 79 this->type = type; 76 80 this->init(); 77 81 this->networkSocket = new NetworkSocket(address); … … 86 90 : DataStream() 87 91 { 92 this->type = type; 88 93 this->init(); 89 94 this->networkSocket = new NetworkSocket(); … … 134 139 PRINT(0)("============= DOWNSTREAM:===============\n"); 135 140 /* first of all read the synchronizeable's data: */ 136 //if(this->isServer())137 dataLength = this->synchronizeables->readBytes((byte*)downBuffer);141 if( this->isServer()) 142 dataLength = this->synchronizeables->readBytes((byte*)downBuffer); 138 143 139 144 if( dataLength > 0) … … 181 186 if( dataLength == this->packetHeader.length) 182 187 { 183 printf("NetworkStream::processData() - Got Data: \n");188 printf("NetworkStream::processData() - Got Data: %i bytes\n", dataLength); 184 189 /* send the received data to connectionMonitor */ 185 190 this->connectionMonitor->processPacket((byte*)upBuffer, this->packetHeader.length); 186 191 /* now pass the data to the sync object */ 187 //if(!this->isServer())188 this->synchronizeables->writeBytes((byte*)upBuffer, this->packetHeader.length);192 if( !this->isServer()) 193 this->synchronizeables->writeBytes((byte*)upBuffer, this->packetHeader.length); 189 194 190 195 this->state = NET_REC_HEADER;
Note: See TracChangeset
for help on using the changeset viewer.