osx has no nonblock on sockets, work around