Changeset 7411
- Timestamp:
- Sep 11, 2010, 4:14:13 PM (14 years ago)
- Location:
- code/branches/ipv6/src/libraries/network
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/ipv6/src/libraries/network/LANDiscoverable.cc
r7402 r7411 100 100 if( strcmp( LAN_DISCOVERY_MESSAGE, (char*)event.packet->data ) == 0 ) // check for a suitable orxonox client 101 101 { 102 COUT(4) << "Received LAN discovery message from " << event.peer->host << std::endl; 102 103 packet::ServerInformation info; 103 104 info.setServerName("Orxonox Server"); -
code/branches/ipv6/src/libraries/network/LANDiscovery.cc
r7402 r7411 80 80 case ENET_EVENT_TYPE_CONNECT: 81 81 { 82 //COUT(0) << "connect from server: " << event.peer->address.host << endl; FIXME82 COUT(4) << "connect from server: " << event.peer->address << endl; 83 83 ENetPacket* packet = enet_packet_create(LAN_DISCOVERY_MESSAGE, strlen(LAN_DISCOVERY_MESSAGE)+1, ENET_PACKET_FLAG_RELIABLE); 84 84 enet_peer_send(event.peer, 0, packet); … … 88 88 { 89 89 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; 91 91 std::vector<packet::ServerInformation>::iterator it; 92 92 for( it=this->servers_.begin(); it!=this->servers_.end(); ++it ) -
code/branches/ipv6/src/libraries/network/packet/ServerInformation.cc
r7320 r7411 47 47 ServerInformation::ServerInformation(ENetEvent* event) 48 48 { 49 char serverIP[64]; 50 49 51 // Save Server Round Trip Time 50 52 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 53 54 enet_address_get_host_ip(&event->peer->address, serverIP, 64); 54 55 this->serverIP_ = std::string(serverIP); … … 81 82 82 83 } // 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 } 83 92 } // namespace orxonox 84 93 -
code/branches/ipv6/src/libraries/network/packet/ServerInformation.h
r7163 r7411 59 59 60 60 } 61 62 _UtilExport std::ostream& operator<<(std::ostream& out, const ENetAddress& address); 61 63 } 62 64
Note: See TracChangeset
for help on using the changeset viewer.