diff --git a/src/input_output/FGfdmSocket.cpp b/src/input_output/FGfdmSocket.cpp index e6e40a0e12c46a65ccf166b6f4b0bed8ab6b45d8..9fda62d452b63c6ef2208ccee0cf8a366f167f5f 100644 --- a/src/input_output/FGfdmSocket.cpp +++ b/src/input_output/FGfdmSocket.cpp @@ -72,17 +72,9 @@ FGfdmSocket::FGfdmSocket(const string& address, int port, int protocol) else cout << "Winsock DLL not initialized ..." << endl; #endif - if (!is_number(address)) { if ((host = gethostbyname(address.c_str())) == NULL) { - cout << "Could not get host net address by name..." << endl; - } - } else { - unsigned int ip; - ip = inet_addr(address.c_str()); - if ((host = gethostbyaddr((char*)&ip, address.size(), PF_INET)) == NULL) { - cout << "Could not get host net address by number..." << endl; + cout << "Could not get host net address by name..." << endl; } - } if (host != NULL) { if (protocol == ptUDP) { //use udp protocol @@ -132,14 +124,8 @@ FGfdmSocket::FGfdmSocket(const string& address, int port) cout << "Host name... " << address << ", Port... " << port << "." << endl; cout << "Host name... (char) " << address.c_str() << "." << endl; - if (!is_number(address)) { - if ((host = gethostbyname(address.c_str())) == NULL) { + if ((host = gethostbyname(address.c_str())) == NULL) { cout << "Could not get host net address by name..." << endl; - } - } else { - if ((host = gethostbyaddr(address.c_str(), address.size(), PF_INET)) == NULL) { - cout << "Could not get host net address by number..." << endl; - } } if (host != NULL) {