API documentation of Agoric SDK / Exports / @agoric/network / types / ProtocolHandler
Interface: ProtocolHandler
@agoric/network.types.ProtocolHandler
A handler for things the protocol implementation will invoke
Table of contents
Properties
Properties
generatePortID
• generatePortID: (localAddr: string, p: Remote<ProtocolHandler>) => PromiseVow<string>
Create a fresh port identifier for this protocol
Type declaration
▸ (localAddr, p): PromiseVow<string>
Parameters
| Name | Type |
|---|---|
localAddr | string |
p | Remote<ProtocolHandler> |
Returns
PromiseVow<string>
Defined in
packages/network/src/types.js:131
onBind
• onBind: (port: Remote<Port>, localAddr: string, p: Remote<ProtocolHandler>) => PromiseVow<void>
A port will be bound
Type declaration
▸ (port, localAddr, p): PromiseVow<void>
Parameters
| Name | Type |
|---|---|
port | Remote<Port> |
localAddr | string |
p | Remote<ProtocolHandler> |
Returns
PromiseVow<void>
Defined in
packages/network/src/types.js:137
onConnect
• onConnect: (port: Remote<Port>, localAddr: string, remote: string, c: Remote<ConnectionHandler>, p: Remote<ProtocolHandler>) => PromiseVow<AttemptDescription>
A port initiates an outbound connection
Type declaration
▸ (port, localAddr, remote, c, p): PromiseVow<AttemptDescription>
Parameters
| Name | Type |
|---|---|
port | Remote<Port> |
localAddr | string |
remote | string |
c | Remote<ConnectionHandler> |
p | Remote<ProtocolHandler> |
Returns
PromiseVow<AttemptDescription>
Defined in
packages/network/src/types.js:166
onCreate
• onCreate: (protocol: Remote<ProtocolImpl>, p: Remote<ProtocolHandler>) => PromiseVow<void>
This protocol is created
Type declaration
▸ (protocol, p): PromiseVow<void>
Parameters
| Name | Type |
|---|---|
protocol | Remote<ProtocolImpl> |
p | Remote<ProtocolHandler> |
Returns
PromiseVow<void>
Defined in
packages/network/src/types.js:129
onInstantiate
• onInstantiate: undefined | (port: Remote<Port>, localAddr: string, remote: string, p: Remote<ProtocolHandler>) => PromiseVow<string>
Return unique suffix for local address
Defined in
packages/network/src/types.js:158
onListen
• onListen: (port: Remote<Port>, localAddr: string, listenHandler: Remote<ListenHandler>, p: Remote<ProtocolHandler>) => PromiseVow<void>
A port was listening
Type declaration
▸ (port, localAddr, listenHandler, p): PromiseVow<void>
Parameters
| Name | Type |
|---|---|
port | Remote<Port> |
localAddr | string |
listenHandler | Remote<ListenHandler> |
p | Remote<ProtocolHandler> |
Returns
PromiseVow<void>
Defined in
packages/network/src/types.js:144
onListenRemove
• onListenRemove: (port: Remote<Port>, localAddr: string, listenHandler: Remote<ListenHandler>, p: Remote<ProtocolHandler>) => PromiseVow<void>
A port listener has been reset
Type declaration
▸ (port, localAddr, listenHandler, p): PromiseVow<void>
Parameters
| Name | Type |
|---|---|
port | Remote<Port> |
localAddr | string |
listenHandler | Remote<ListenHandler> |
p | Remote<ProtocolHandler> |
Returns
PromiseVow<void>
Defined in
packages/network/src/types.js:151
onRevoke
• onRevoke: (port: Remote<Port>, localAddr: string, p: Remote<ProtocolHandler>) => PromiseVow<void>
The port is being completely destroyed
Type declaration
▸ (port, localAddr, p): PromiseVow<void>
Parameters
| Name | Type |
|---|---|
port | Remote<Port> |
localAddr | string |
p | Remote<ProtocolHandler> |
Returns
PromiseVow<void>