use htons for port (needed for Mac OS X)