Draining data from socket, switching to non-blocking