A port that has been bound to a protocol

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

Properties

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

Begin accepting incoming connections

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

Make an outbound connection

getLocalAddress: (() => string)

Get the locally bound name of this port

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

Remove the currently-bound listener

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

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