Set sockets to unblocking.

Corrected receive and some logging.