TCPListenNotify¶
Callbacks for a TCP listener. Implement this trait and pass it to
TCPListener to handle listener events.
on_connected and on_not_listening have no default implementations.
on_connected is where you create the notifier for each accepted
connection. on_not_listening must be implemented because ignoring a listen
failure silently is never correct.
Public Functions¶
on_listening¶
Called when the listener is ready to accept connections.
Parameters¶
- listen: TCPListener ref
Returns¶
- None val
on_not_listening¶
Called when the listener could not open its socket.
Parameters¶
- listen: TCPListener ref
Returns¶
- None val
on_connected¶
Called when a client connects. Return a ServerTCPConnectionNotify for
the new connection. Raise an error to reject the connection.
Parameters¶
- listen: TCPListener ref
Returns¶
- ServerTCPConnectionNotify iso^ ?
on_closed¶
Called after the listener is closed.
Parameters¶
- listen: TCPListener ref
Returns¶
- None val