Added support for nonblocking sockets