Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7773


Ignore:
Timestamp:
Dec 17, 2010, 11:09:14 AM (13 years ago)
Author:
scheusso
Message:

small fix (ensure correct termination of communicationThread)

Location:
code/branches/network5/src/libraries/network
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • code/branches/network5/src/libraries/network/ClientConnection.cc

    r7772 r7773  
    3939  const unsigned int NETWORK_CLIENT_CONNECTION_TIMEOUT = 3000; //millisecs
    4040  const unsigned int NETWORK_CLIENT_MAX_CONNECTIONS = 1;
    41   const unsigned int NETWORK_CLIENT_CHANNELS = 1;
    4241
    4342
     
    7170    ENetEvent event;
    7271
    73     this->host_ = enet_host_create(NULL, NETWORK_CLIENT_MAX_CONNECTIONS, 0, 0, 0);
     72    this->host_ = enet_host_create(NULL, NETWORK_CLIENT_MAX_CONNECTIONS, NETWORK_CHANNEL_COUNT, 0, 0);
    7473    if ( this->host_ == NULL )
    7574    {
     
    8685        COUT(3) << "Info: Using IPv4 and IPv6 Sockets." << std::endl;
    8786
    88     this->server_ = enet_host_connect(this->host_, serverAddress_, NETWORK_CLIENT_CHANNELS, 0);
     87    this->server_ = enet_host_connect(this->host_, serverAddress_, NETWORK_CHANNEL_COUNT, 0);
    8988    if ( this->server_==NULL )
    9089    {
     
    155154    COUT(1) << "Received disconnect Packet from Server!" << endl;
    156155        // server closed the connection
     156    this->stopCommunicationThread();
    157157    this->connectionClosed();
    158158  }
  • code/branches/network5/src/libraries/network/GamestateManager.cc

    r7759 r7773  
    216216
    217217
    218     bool b = gs->compressData();
    219     assert(b);
     218//     bool b = gs->compressData();
     219//     assert(b);
    220220      clock.capture();
    221221      COUT(4) << "diff and compress time: " << clock.getDeltaTime() << endl;
  • code/branches/network5/src/libraries/network/NetworkPrereqs.h

    r7772 r7773  
    6868  extern const char* LAN_DISCOVERY_MESSAGE;
    6969  extern const char* LAN_DISCOVERY_ACK;
    70   static const unsigned int LAN_DISCOVERY_PORT        = 55557;
    71   static const unsigned int NETWORK_PEER_ID_SERVER    = 0;
    72   static const unsigned int NETWORK_CHANNEL_DEFAULT   = 0;
    73   static const unsigned int NETWORK_CHANNEL_RELIABLE  = 1;
     70  static const unsigned int LAN_DISCOVERY_PORT          = 55557;
     71  static const unsigned int NETWORK_PEER_ID_SERVER      = 0;
     72  static const unsigned int NETWORK_CHANNEL_DEFAULT     = 0;
     73  static const unsigned int NETWORK_CHANNEL_UNRELIABLE  = 1;
     74  static const unsigned int NETWORK_CHANNEL_COUNT       = 2;
    7475}
    7576
  • code/branches/network5/src/libraries/network/Server.cc

    r7772 r7773  
    425425    if(!b)
    426426      return false; //no data for the client
    427     b = g->compressData();
    428     assert(b);
     427//     b = g->compressData();
     428//     assert(b);
    429429    b = g->send();
    430430    assert(b);
  • code/branches/network5/src/libraries/network/ServerConnection.cc

    r7772 r7773  
    6868  bool ServerConnection::openListener()
    6969  {
    70     this->host_ = enet_host_create(this->bindAddress_, NETWORK_MAX_CONNECTIONS, 0, 0, 0);
     70    this->host_ = enet_host_create(this->bindAddress_, NETWORK_MAX_CONNECTIONS, NETWORK_CHANNEL_COUNT, 0, 0);
    7171    if ( this->host_ == NULL )
    7272    {
     
    9191    this->bListening_=false;
    9292    disconnectClients();
     93    Connection::stopCommunicationThread();
    9394    enet_host_destroy(this->host_);
    9495    return true;
  • code/branches/network5/src/libraries/network/packet/Packet.cc

    r7772 r7773  
    169169//  enetPacket_ = 0; // otherwise we have a double free because enet already handles the deallocation of the packet
    170170  if( this->flags_ & PacketFlag::Reliable )
    171     Host::addPacket( enetPacket_, clientID_, 0);
     171    Host::addPacket( enetPacket_, clientID_, NETWORK_CHANNEL_DEFAULT);
    172172  else
    173     Host::addPacket( enetPacket_, clientID_, 0);
     173    Host::addPacket( enetPacket_, clientID_, NETWORK_CHANNEL_UNRELIABLE);
    174174  return true;
    175175}
Note: See TracChangeset for help on using the changeset viewer.