Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Sep 11, 2010, 4:14:13 PM (14 years ago)
Author:
adrfried
Message:

more debug output added

Location:
code/branches/ipv6/src/libraries/network
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • code/branches/ipv6/src/libraries/network/LANDiscoverable.cc

    r7402 r7411  
    100100          if( strcmp( LAN_DISCOVERY_MESSAGE, (char*)event.packet->data ) == 0 )      // check for a suitable orxonox client
    101101          {
     102            COUT(4) << "Received LAN discovery message from " << event.peer->host << std::endl;
    102103            packet::ServerInformation info;
    103104            info.setServerName("Orxonox Server");
  • code/branches/ipv6/src/libraries/network/LANDiscovery.cc

    r7402 r7411  
    8080        case ENET_EVENT_TYPE_CONNECT:
    8181        {
    82           //COUT(0) << "connect from server: " << event.peer->address.host << endl; FIXME
     82          COUT(4) << "connect from server: " << event.peer->address << endl;
    8383          ENetPacket* packet = enet_packet_create(LAN_DISCOVERY_MESSAGE, strlen(LAN_DISCOVERY_MESSAGE)+1, ENET_PACKET_FLAG_RELIABLE);
    8484          enet_peer_send(event.peer, 0, packet);
     
    8888          {
    8989            packet::ServerInformation info(&event);
    90             COUT(0) << "received server information; name: " << info.getServerName() << ", IP: " << info.getServerIP() << ", RTT: " << info.getServerRTT() << endl;
     90            COUT(3) << "received server information; Name: " << info.getServerName() << ", Address: " << info.getServerIP() << ", RTT: " << info.getServerRTT() << endl;
    9191            std::vector<packet::ServerInformation>::iterator it;
    9292            for( it=this->servers_.begin(); it!=this->servers_.end(); ++it )
  • code/branches/ipv6/src/libraries/network/packet/ServerInformation.cc

    r7320 r7411  
    4747    ServerInformation::ServerInformation(ENetEvent* event)
    4848    {
     49      char serverIP[64];
     50
    4951      // Save Server Round Trip Time
    5052      this->serverRTT_ = event->peer->roundTripTime;
    51       // Save Server IP, leave some space for scope ID
    52       char* serverIP = new char[64];
     53      // Save Server Address, leave some space for scope ID
    5354      enet_address_get_host_ip(&event->peer->address, serverIP, 64);
    5455      this->serverIP_ = std::string(serverIP);
     
    8182 
    8283  } // namespace packet
     84
     85  std::ostream& operator<<(std::ostream& out, const ENetAddress& address)
     86  {
     87      char addr[64];
     88      if (!enet_address_get_host_ip(&address, addr, 64))
     89          out << addr;
     90      return out;
     91  }
    8392} // namespace orxonox
    8493
  • code/branches/ipv6/src/libraries/network/packet/ServerInformation.h

    r7163 r7411  
    5959
    6060  }
     61
     62  _UtilExport std::ostream& operator<<(std::ostream& out, const ENetAddress& address);
    6163}
    6264
Note: See TracChangeset for help on using the changeset viewer.