Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


Ignore:
Timestamp:
Nov 28, 2005, 6:36:16 PM (19 years ago)
Author:
patrick
Message:

network: added some simulated network delay - this helps a lot for debugging :D

Location:
branches/network/src/lib/network
Files:
4 edited

Legend:

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

    r5804 r5805  
    139139NetworkStream& NetworkManager::createServer(Synchronizeable& sync, unsigned int port)
    140140{
    141   printf("Create a new server socket, liestening on port %u...\n", port);
     141  PRINTF(0)("Create a new server socket\n");
    142142  /* creating a new network stream, it will register itself automaticaly to the class list */
    143143  NetworkStream* netStream = new NetworkStream(sync, port, NET_SERVER);
  • branches/network/src/lib/network/network_protocol.cc

    r5802 r5805  
    6868    return -1;
    6969
     70//   for(int i = 0; i < length; i++)
     71//     printf("send byte[%i]=%u\n", i, data[i]);
     72
    7073  //Create space for the header
    7174  for( int i = length - 1; i >= 0; i--)
     
    102105  h.data = data;
    103106
     107//   for(int i = 0; i < length; i++)
     108//     printf("recS byte[%i]=%u\n", i, data[i]);
     109
    104110  //Remove header
    105111  for (int i = headerLength; i < length; i++)
  • branches/network/src/lib/network/network_socket.cc

    r5804 r5805  
    163163  tcpSocket = NULL;
    164164  SDL_mutexV(socketMutex);
    165 
    166165}
    167166
     
    220219  SDL_mutexV(outgoingBufferMutex);
    221220
     221
    222222  return nbytes;
    223223#else
     
    395395#undef min
    396396
    397     //printf("thread_write nbytes=%d listening=%d\n", nbytestowrite, (int)self->_isListening);
     397//     printf("thread_write nbytes=%d listening=%d\n", nbytestowrite, (int)self->_isListening);
    398398
    399399    //if buffer is full
     
    431431  }
    432432
     433  printf("QUIT WRITE THREAD\n");
    433434  return 0;
    434435}
  • branches/network/src/lib/network/network_stream.cc

    r5804 r5805  
    8686 networkSocket->disconnectServer();
    8787
    88  delete networkSocket;
     88 if( this->networkSocket)
     89   delete networkSocket;
     90
    8991 delete connectionMonitor;
    9092 delete networkProtocol;
     
    107109                                            *(this->synchronizeables), 12);
    108110
    109   printf("created header: data packet wights: %i bytes\n", ret);
    110111  /* pass the data to the network socket */
    111112  ret = this->networkSocket->writeBytes((byte*)downBuffer, ret);
    112113  /* check if there was an error */
    113   printf("NetworkSocket: sent %i bytes\n", ret);
    114114  if( ret == -1) { PRINTF(0)("Error in writing data to the NetworkSocket\n");}
    115115
     
    122122  ret = this->networkSocket->readBlock((byte*)upBuffer, 11/* this is very bad: hard coded packet sizes! */);
    123123  /* error checking: data read? */
    124   printf("NetworkSocket: received %i bytes\n", ret);
    125124  if( ret != 11 /*PACKAGE_SIZE + sizeof(Header)*/) { PRINTF(0)("Error while reading data from the NetworkSocket. Skipping further work\n");}
    126125  else
Note: See TracChangeset for help on using the changeset viewer.