opt: The socket events handling.