Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7553 in orxonox.OLD for branches


Ignore:
Timestamp:
May 6, 2006, 1:23:16 PM (19 years ago)
Author:
rennerc
Message:

fixed some bugs

Location:
branches/network/src
Files:
3 edited

Legend:

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

    r7540 r7553  
    100100      UdpSocket * sock = new UdpSocket( this, packet->address, userId );
    101101      newSocketList.push_back( sock );
     102      PRINTF(0)("NEW CONNECTION %x\n", packet->address.host );
    102103    }
    103104   
     
    111112  }
    112113 
    113   assert( res = 0 );
    114  
    115   NetworkSocket * result = newSocketList.front();
    116  
    117   newSocketList.pop_front();
     114  assert( res == 0 );
     115 
     116  NetworkSocket * result = NULL;
     117 
     118  if ( newSocketList.size() > 0 )
     119  {
     120    result = newSocketList.front();
     121 
     122    newSocketList.pop_front();
     123  }
    118124 
    119125  return result;
     
    199205{
    200206  int channel = SDLNet_UDP_Bind( socket, userId, &ip );
    201   if( channel == userId )
     207  if( channel != userId )
    202208  {
    203209    PRINTF(1)("SDLNet_UDP_Bind: %s\n", SDLNet_GetError());
  • branches/network/src/lib/network/udp_socket.cc

    r7541 r7553  
    107107  }
    108108 
    109   int channel = SDLNet_UDP_Bind(socket, -1, &ip);
     109  int channel = SDLNet_UDP_Bind(socket, 1, &ip);
    110110  if ( channel == -1 )
    111111  {
  • branches/network/src/subprojects/network/network_unit_test.cc

    r7552 r7553  
    4242  NetworkSocket* client1 = new UdpSocket("localhost", 9999);
    4343
    44   NetworkSocket* server1 = server.getNewSocket();
     44  client1->writePacket( (byte*)"test", 5 );
     45  NetworkSocket* server1 = NULL;
     46  while ( server1 == NULL )
     47    server1 = server.getNewSocket();
     48 
     49  assert( server1->isOk() );
    4550
    4651  NetworkSocket* client2 = new UdpSocket("localhost", 9999);
    4752
    48   NetworkSocket* server2 = server.getNewSocket();
     53  client2->writePacket( (byte*)"test", 5 );
     54  NetworkSocket* server2 = NULL;
     55  while ( server2 == NULL )
     56    server2 = server.getNewSocket();
    4957
    5058  char buf[1024];
Note: See TracChangeset for help on using the changeset viewer.