Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 30, 2005, 11:09:18 AM (18 years ago)
Author:
patrick
Message:

network: server/client orxonox now works

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/network/src/lib/network/network_stream.cc

    r5829 r5833  
    4444  this->init();
    4545  /* initialize the references */
     46  this->type = NET_CLIENT;
    4647  this->networkSocket = new NetworkSocket();
    4748  this->networkProtocol = new NetworkProtocol();
     
    5253NetworkStream::NetworkStream(IPaddress& address, NodeType type)
    5354{
     55  this->type = type;
    5456  this->init();
    5557  this->networkSocket = new NetworkSocket(address);
     
    6264NetworkStream::NetworkStream(unsigned int port, NodeType type)
    6365{
     66  this->type = type;
    6467  this->init();
    6568  this->networkSocket = new NetworkSocket();
     
    7477    : DataStream()
    7578{
     79  this->type = type;
    7680  this->init();
    7781  this->networkSocket = new NetworkSocket(address);
     
    8690    : DataStream()
    8791{
     92  this->type = type;
    8893  this->init();
    8994  this->networkSocket = new NetworkSocket();
     
    134139  PRINT(0)("============= DOWNSTREAM:===============\n");
    135140  /* 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);
    138143
    139144  if( dataLength > 0)
     
    181186    if( dataLength == this->packetHeader.length)
    182187    {
    183       printf("NetworkStream::processData() - Got Data: \n");
     188      printf("NetworkStream::processData() - Got Data: %i bytes\n", dataLength);
    184189      /* send the received data to connectionMonitor */
    185190      this->connectionMonitor->processPacket((byte*)upBuffer, this->packetHeader.length);
    186191      /* 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);
    189194
    190195      this->state = NET_REC_HEADER;
Note: See TracChangeset for help on using the changeset viewer.