long IP2Long(std::string &ipString)
{
long result = 0;
size_t startPos = 0;
for ( int ii = 0; ii < 4; ii++ )
{
size_t dot = ipString.find('.', startPos);
int num = ::atoi(ipString.substr(startPos, dot-startPos).c_str());
result *= 256;
result += num;
startPos = dot+1;
}
return ::htonl(result);
}
heres my IP2LONG
if you going to close the connection to the FDS, its also good practice to send off
Send_Message("bye", IP2Long((string)"127.0.0.1"), 4849);
you could also try hard codeing the IP2LONG value for 127.0.0.1, which is what i do on NR , it is: 16777343