Constructors
constructor
- new Host(ipAddress, port, peerLimit, channelLimit, usingNewPacket): Host
Parameters
- ipAddress: string
- port: number
- peerLimit: number
- channelLimit: number
- usingNewPacket: boolean
Accessors
ipAddress
- get ipAddress(): string
Returns string
port
- get port(): number
Returns number
Methods
connect
- connect(ipAddress, port): boolean
Parameters
- ipAddress: string
- port: number
Returns boolean
disconnect
- disconnect(netId): boolean
Returns boolean
disconnectLater
- disconnectLater(netId): boolean
Returns boolean
disconnectNow
- disconnectNow(netId): boolean
Returns boolean
getPeerData
- getPeerData(netId): object
Returns object
send
- send(netId, data, channelId): boolean
Parameters
- netId: number
- data: Buffer
- channelId: number
Returns boolean
service
- service(): void
Returns void
setEmitter
- setEmitter(emitter): void
Parameters
- emitter: ((...args: any[]) => any)
- (...args): any
Returns any
Returns void