INADDR_LOOPBACK is in host byte order, need to use htonl