Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5742 in orxonox.OLD for branches/network/src/lib


Ignore:
Timestamp:
Nov 23, 2005, 4:19:54 PM (19 years ago)
Author:
bottac
Message:
 
File:
1 edited

Legend:

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

    r5741 r5742  
    103103  this->connectionMonitor->processPacket((byte*)downBuffer, PACKAGE_SIZE);
    104104
    105         this->networkProtocol->createHeader((byte*) downBuffer , PACKAGE_SIZE, 1024,*(this->synchronizeables),12);
     105        this->networkProtocol->createHeader((byte*) downBuffer , PACKAGE_SIZE , 1024,*(this->synchronizeables),12);
    106106       
    107107  /* pass the data to the network socket */
    108   ret = this->networkSocket->writeBytes((byte*)downBuffer, PACKAGE_SIZE);
     108  ret = this->networkSocket->writeBytes((byte*)downBuffer, PACKAGE_SIZE + sizeof(Header));
    109109  /* check if there was an error */
    110110  if( ret == -1) { PRINTF(0)("Error in writing data to the NetworkSocket\n");}
     
    116116  ret = 0;
    117117
    118   while(ret == 0)  ret = this->networkSocket->readBlock((byte*)upBuffer,PACKAGE_SIZE);
     118  /* first of all read  data from networkSocket*/
     119  while(ret == 0)
     120  ret = this->networkSocket->readBlock((byte*)upBuffer,PACKAGE_SIZE + sizeof(Header));
    119121  /* error checking: data read? */
    120122  if( ret != PACKAGE_SIZE) { PRINTF(0)("Error while reading data from the NetworkSocket\n");}
    121123
    122124  /* send the received data to connectionMonitor */
    123   this->connectionMonitor->processPacket((byte*)upBuffer, PACKAGE_SIZE);
     125  this->connectionMonitor->processPacket((byte*)upBuffer, PACKAGE_SIZE + sizeof(Header));
    124126
    125127  /* extract Header */
    126   this->networkProtocol->extractHeader((byte*) upBuffer , PACKAGE_SIZE);
     128  this->networkProtocol->extractHeader((byte*) upBuffer , PACKAGE_SIZE + sizeof(Header));
    127129   
    128130  /* now pass the data to the sync object */
Note: See TracChangeset for help on using the changeset viewer.