Non-blocking sockets and PEP8 cleanup