- changed required for compiling and running on mac osx.

The main challenge was to figure out that SOCK_NONBLOCK is not valid on OSX. Instead I had to use `socket` followed by `fcntl`.