else cout << "Winsock DLL not initialized ..." << endl;
#endif
- if (address.find_first_not_of("0123456789.",0) != address.npos) {
+ if (!is_number(address)) {
if ((host = gethostbyname(address.c_str())) == NULL) {
cout << "Could not get host net address by name..." << endl;
}
cout << "Host name... " << address << ", Port... " << port << "." << endl;
cout << "Host name... (char) " << address.c_str() << "." << endl;
- if (address.find_first_not_of("0123456789.",0) != address.npos) {
+ if (!is_number(address)) {
if ((host = gethostbyname(address.c_str())) == NULL) {
cout << "Could not get host net address by name..." << endl;
}