A port that has been bound to a protocol

interface Port {
    addListener: ((acceptHandler) => PromiseVow<void>);
    connect: ((remote, connectionHandler?) => PromiseVow<Connection>);
    getLocalAddress: (() => string);
    removeListener: ((acceptHandler) => PromiseVow<void>);
    revoke: (() => PromiseVow<void>);
}

Properties

addListener: ((acceptHandler) => PromiseVow<void>)

Begin accepting incoming connections

Type declaration

    • (acceptHandler): PromiseVow<void>
    • Parameters

      Returns PromiseVow<void>

connect: ((remote, connectionHandler?) => PromiseVow<Connection>)

Make an outbound connection

Type declaration

getLocalAddress: (() => string)

Get the locally bound name of this port

Type declaration

    • (): string
    • Returns string

removeListener: ((acceptHandler) => PromiseVow<void>)

Remove the currently-bound listener

Type declaration

    • (acceptHandler): PromiseVow<void>
    • Parameters

      Returns PromiseVow<void>

revoke: (() => PromiseVow<void>)

Deallocate the port entirely, removing all listeners and closing all active connections

Type declaration

    • (): PromiseVow<void>
    • Returns PromiseVow<void>