Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5747 in orxonox.OLD for branches/network/src


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

Location:
branches/network/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/network/src/lib/network/data_stream.h

    r5728 r5747  
    1313#include "netdefs.h"
    1414
     15#define DATA_STREAM_BUFFER_SIZE 1024
     16
    1517class DataStream : public BaseObject
    1618{
     
    1820      DataStream();
    1921      DataStream(DataStream& inStream, DataStream& outStream);
    20      
    2122      ~DataStream();
    22            
     23
    2324
    2425      void connectUpStream(DataStream& upStream);
     
    3738      int passUp(byte* data);
    3839
    39       byte* upBuffer [1024];
    40       byte* downBuffer [1024];
     40      byte* upBuffer [DATA_STREAM_BUFFER_SIZE];
     41      byte* downBuffer [DATA_STREAM_BUFFER_SIZE];
    4142      unsigned int bufferSize;
    4243      DataStream* upStream;
  • 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}
  • branches/network/src/subprojects/network/network_unit_test.cc

    r5733 r5747  
    169169    //else if(!strcmp( "--gui", argv[i]) || !strcmp("-g", argv[i])) showGui = true;
    170170    if (! strcmp( "--sockettest", argv[i]) || !strcmp("-s", argv[i])) return testSocket(argc, argv);
    171     else if (! strcmp( "--frameworktest", argv[i]) || !strcmp("-s", argv[i])) return testFramework(argc, argv);
     171    else if (! strcmp( "--frameworktest", argv[i]) || !strcmp("-f", argv[i])) return testFramework(argc, argv);
    172172  }
    173173
     
    180180bool ShellBuffer::addBufferLineStatic(const char* line, ...)
    181181{
    182   va_list arguments;
    183   vprintf(line, arguments);
     182  //va_list arguments;
     183  //vprintf(line, arguments);
     184  printf("%s", line);
    184185
    185186}
Note: See TracChangeset for help on using the changeset viewer.