Improve sockets IO by processing all pending messages.