Skip to content

TCPListenNotify

[Source]

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.

trait ref TCPListenNotify

Public Functions

on_listening

[Source]

Called when the listener is ready to accept connections.

fun ref on_listening(
  listen: TCPListener ref)
: None val

Parameters

Returns


on_not_listening

[Source]

Called when the listener could not open its socket.

fun ref on_not_listening(
  listen: TCPListener ref)
: None val

Parameters

Returns


on_connected

[Source]

Called when a client connects. Return a ServerTCPConnectionNotify for the new connection. Raise an error to reject the connection.

fun ref on_connected(
  listen: TCPListener ref)
: ServerTCPConnectionNotify iso^ ?

Parameters

Returns


on_closed

[Source]

Called after the listener is closed.

fun ref on_closed(
  listen: TCPListener ref)
: None val

Parameters

Returns