Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 15, 2010, 2:51:39 PM (13 years ago)
Author:
smerkli
Message:

disconnect implemented, switching to only use the MSC object of wandiscovery.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation/src/libraries/network/MasterServerComm.cc

    r7761 r7763  
    4141  {
    4242    /* initialize Enet */
    43     if (enet_initialize () != 0)
     43    if( enet_initialize () != 0 )
    4444    { COUT(1) << "An error occurred while initializing ENet.\n";
    4545      return 1;
     
    5959    /* see if it worked */
    6060    if (this->client == NULL)
    61     { COUT(1) << "An error occurred while trying to create an ENet client host.\n";
     61    { COUT(1) << "An error occurred while trying to create an "
     62        << "ENet client host.\n";
    6263      return 1;
    6364    }
     
    7071    /* destroy the enet facilities */
    7172    enet_host_destroy(this->client);
    72 
    73     /* install atexit handler for enet */
    74     enet_deinitialize();
    7573  }
    7674
     
    8482    this->peer = enet_host_connect(this->client, &this->address, 2, 0);   
    8583
    86     if (this->peer == NULL )
    87     { COUT(2) << "ERROR: No available peers for initiating an ENet connection.\n";
     84    if( this->peer == NULL )
     85    { COUT(2) << "ERROR: No available peers for initiating an ENet"
     86        << " connection.\n";
    8887      return -1;
    8988    }
     
    9695    {
    9796      enet_peer_reset (this->peer);
    98       fprintf( stdout, "Connection to %s failed.", address );
    9997      COUT(2) << "ERROR: connection to " << address << " failed.\n";
    10098      return -1;
     
    240238    /* One could just use enet_host_service() instead. */
    241239    enet_host_flush( this->client );
    242     if( packet ) free( packet );
     240    enet_packet_destroy( packet );
    243241
    244242    /* all done. */
Note: See TracChangeset for help on using the changeset viewer.