- Timestamp:
- Dec 15, 2010, 2:51:39 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation/src/libraries/network/MasterServerComm.cc
r7761 r7763 41 41 { 42 42 /* initialize Enet */ 43 if (enet_initialize () != 0)43 if( enet_initialize () != 0 ) 44 44 { COUT(1) << "An error occurred while initializing ENet.\n"; 45 45 return 1; … … 59 59 /* see if it worked */ 60 60 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"; 62 63 return 1; 63 64 } … … 70 71 /* destroy the enet facilities */ 71 72 enet_host_destroy(this->client); 72 73 /* install atexit handler for enet */74 enet_deinitialize();75 73 } 76 74 … … 84 82 this->peer = enet_host_connect(this->client, &this->address, 2, 0); 85 83 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"; 88 87 return -1; 89 88 } … … 96 95 { 97 96 enet_peer_reset (this->peer); 98 fprintf( stdout, "Connection to %s failed.", address );99 97 COUT(2) << "ERROR: connection to " << address << " failed.\n"; 100 98 return -1; … … 240 238 /* One could just use enet_host_service() instead. */ 241 239 enet_host_flush( this->client ); 242 if( packet ) free( packet );240 enet_packet_destroy( packet ); 243 241 244 242 /* all done. */
Note: See TracChangeset
for help on using the changeset viewer.