Constructors
constructor
- new Host(
ipAddress: string,
port: number,
peerLimit: number,
channelLimit: number,
usingNewPacket: boolean,
): 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: string, port: number): boolean
Parameters
- ipAddress: string
- port: number
Returns boolean
disconnect
- disconnect(netId: number): boolean
Returns boolean
disconnectLater
- disconnectLater(netId: number): boolean
Returns boolean
disconnectNow
- disconnectNow(netId: number): boolean
Returns boolean
getPeerData
- getPeerData(netId: number): object
Returns object
send
- send(netId: number, data: Buffer, channelId: number): boolean
Parameters
- netId: number
- data: Buffer
- channelId: number
Returns boolean
service
- service(): void
Returns void
setEmitter
- setEmitter(emitter: (...args: any[]) => any): void
Parameters
- emitter: (...args: any[]) => any
Returns void
setPingInterval
- setPingInterval(netId: number, pingInterval: number): boolean
Parameters
- netId: number
- pingInterval: number
Returns boolean
setTimeout
- setTimeout(netId: number, limit: number, min: number, max: number): boolean
Parameters
- netId: number
- limit: number
- min: number
- max: number
Returns boolean