Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 23, 2005, 11:32:20 PM (19 years ago)
Author:
patrick
Message:

network: some small changes in the NetworkStream and DataStream modules (see mail), printf output in the network_unit_test and short flag

File:
1 edited

Legend:

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

    r5746 r5747  
    1919*/
    2020#define DEBUG_MODULE_NETWORK
    21 #define PACKAGE_SIZE  256
     21
    2222
    2323#include "base_object.h"
     
    3535using namespace std;
    3636
     37
     38#define PACKAGE_SIZE  256
    3739
    3840
     
    102104 
    103105  /* send the received data to connectionMonitor */
    104   this->connectionMonitor->processPacket((byte*)downBuffer, PACKAGE_SIZE);
     106  this->connectionMonitor->processPacket((byte*)downBuffer, ret + sizeof(Header));
    105107
    106         this->networkProtocol->createHeader((byte*) downBuffer , PACKAGE_SIZE , 1024,*(this->synchronizeables),12);
     108  this->networkProtocol->createHeader((byte*)downBuffer, ret, DATA_STREAM_BUFFER_SIZE,
     109                                       *(this->synchronizeables), 12);
    107110       
    108111  /* pass the data to the network socket */
     
    119122  /* first of all read  data from networkSocket*/
    120123  while(ret == 0)
    121   ret = this->networkSocket->readBlock((byte*)upBuffer,PACKAGE_SIZE + sizeof(Header));
     124  ret = this->networkSocket->readBlock((byte*)upBuffer, PACKAGE_SIZE + sizeof(Header));
    122125  /* error checking: data read? */
    123   if( ret != PACKAGE_SIZE) { PRINTF(0)("Error while reading data from the NetworkSocket\n");}
     126  if( ret != PACKAGE_SIZE + sizeof(Header)) { PRINTF(0)("Error while reading data from the NetworkSocket\n");}
    124127
    125128  /* send the received data to connectionMonitor */
     
    130133   
    131134  /* now pass the data to the sync object */
    132   this->synchronizeables->writeBytes((byte*)upBuffer[sizeof(Header)], PACKAGE_SIZE);
     135  this->synchronizeables->writeBytes((byte*)upBuffer, PACKAGE_SIZE);
    133136
    134137}
Note: See TracChangeset for help on using the changeset viewer.