A handler for a given Connection

interface ConnectionHandler {
    onClose: undefined | ((connection, reason?, c?) => PromiseVow<void>);
    onOpen: undefined | ((connection, localAddr, remoteAddr, c) => PromiseVow<void>);
    onReceive: undefined | ((connection, ack, c, opts?) => PromiseVow<string>);
}

Properties

onClose: undefined | ((connection, reason?, c?) => PromiseVow<void>)

The connection has been closed

Type declaration

    • (connection, reason?, c?): PromiseVow<void>
    • Parameters

      Returns PromiseVow<void>

onOpen: undefined | ((connection, localAddr, remoteAddr, c) => PromiseVow<void>)

The connection has been opened

Type declaration

    • (connection, localAddr, remoteAddr, c): PromiseVow<void>
    • Parameters

      Returns PromiseVow<void>

onReceive: undefined | ((connection, ack, c, opts?) => PromiseVow<string>)

The connection received a packet

Type declaration

    • (connection, ack, c, opts?): PromiseVow<string>
    • Parameters

      Returns PromiseVow<string>