Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5808 in orxonox.OLD for branches


Ignore:
Timestamp:
Nov 28, 2005, 9:07:21 PM (19 years ago)
Author:
patrick
Message:

network: valgrinded the network modules - zero error limit reached: small modification in NetworkSocket and ConnectionMonitor, nothing serious

Location:
branches/network/src
Files:
7 edited

Legend:

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

    r5800 r5808  
    7474  /*Do whats needed for Averaging*/
    7575
    76   if(packetCounter = packetToAverage)
     76  if(packetCounter == packetToAverage)
    7777    {
    7878      computeCurrentDatarate();
  • branches/network/src/lib/network/data_stream.cc

    r5728 r5808  
    3131{
    3232  this->setClassID(CL_DATA_STREAM, "DataStream");
     33  this->upBuffer = new byte[DATA_STREAM_BUFFER_SIZE];
     34  this->downBuffer = new byte[DATA_STREAM_BUFFER_SIZE];
    3335}
    3436
     
    4143    this->downStream = &outStream;
    4244    this->upStream = &inStream;
     45
     46    if( this->upBuffer)
     47      delete[] this->upBuffer;
     48    if( this->downBuffer)
     49      delete[] this->downBuffer;
    4350}
    4451
     
    101108void passDown(byte* data, int length)
    102109{
    103      
     110
    104111}
    105112
     
    115122int passUp(byte* data)
    116123{
    117    
     124
    118125}
  • branches/network/src/lib/network/data_stream.h

    r5747 r5808  
    3838      int passUp(byte* data);
    3939
    40       byte* upBuffer [DATA_STREAM_BUFFER_SIZE];
    41       byte* downBuffer [DATA_STREAM_BUFFER_SIZE];
     40      byte* upBuffer;
     41      byte* downBuffer;
    4242      unsigned int bufferSize;
    4343      DataStream* upStream;
  • branches/network/src/lib/network/network_socket.cc

    r5805 r5808  
    3434NetworkSocket::NetworkSocket()
    3535{
     36  this->init();
     37}
     38
     39/**
     40 * Constructor to connect directly
     41 */
     42NetworkSocket::NetworkSocket(IPaddress ip)
     43{
     44  this->init();
     45  connectToServer(ip);
     46}
     47
     48
     49void NetworkSocket::init()
     50{
    3651  /* set the class id for the base object */
    3752  this->setClassID(CL_NETWORK_SOCKET, "NetworkSocket");
     
    5873  PRINTF(0)("NetworkSocket created\n");
    5974
    60 }
    61 
    62 /**
    63  * Constructor to connect directly
    64  */
    65 NetworkSocket::NetworkSocket(IPaddress ip)
    66 {
    67   NetworkSocket();
    68   connectToServer(ip);
    6975}
    7076
     
    255261  int nbytes = (length<incomingBufferLength) ? length : incomingBufferLength;
    256262
     263
    257264  //printf("readBytes: nbytes = %d; length=%d; incomingBufferLength=%d\n", nbytes, length, incomingBufferLength);
    258265
  • branches/network/src/lib/network/network_socket.h

    r5804 r5808  
    8383  int readBlock(byte * data, int length);
    8484
     85private:
     86  void init();
     87
    8588};
    8689
  • branches/network/src/subprojects/network/network_unit_test.cc

    r5806 r5808  
    159159  delete nm;
    160160
     161  delete clientSync;
     162  delete serverSync;
     163
    161164  return 0;
    162165}
  • branches/network/src/subprojects/network/simple_sync.cc

    r5806 r5808  
    3131  : Synchronizeable(name)
    3232{
     33  /* define the local buffer size */
    3334  this->outLength = 10;
    3435  this->recLength = 0;
     
    3738  this->inData = new byte[this->inLength];
    3839
     40  /* init the buffer data */
    3941  for( int i = 0; i < this->outLength; i++)
    4042  {
     
    5456SimpleSync::~SimpleSync()
    5557{
     58  if( this->outData)
     59    delete[] this->outData;
     60  if( this->inData)
     61    delete[] this->inData;
    5662}
    5763
Note: See TracChangeset for help on using the changeset viewer.