Class Socket

Hierarchy

Index

Properties

Methods

Properties

public address: { address: string; family: string; port: number; }

public address.address: string

public address.family: string

public address.port: number

Methods

public addListener(event: string, listener: Function): EventEmitter

Parameters

  • event: string
  • listener: Function

Returns

EventEmitter

public addMembership(multicastAddress: string, multicastInterface?: string)

Parameters

  • multicastAddress: string
  • multicastInterface?: string optional

public bind(port: number, address?: string, callback?: () => void)

Parameters

  • port: number
  • address?: string optional
  • callback?: () => void optional

public close()

public dropMembership(multicastAddress: string, multicastInterface?: string)

Parameters

  • multicastAddress: string
  • multicastInterface?: string optional

public emit(event: string, args?: Array<any>): boolean

Parameters

  • event: string
  • args?: Array<any> optional

Returns

boolean

public listeners(event: string): Array<Function>

Parameters

  • event: string

Returns

Array<Function>

public on(event: string, listener: Function): EventEmitter

Parameters

  • event: string
  • listener: Function

Returns

EventEmitter

public once(event: string, listener: Function): EventEmitter

Parameters

  • event: string
  • listener: Function

Returns

EventEmitter

public removeAllListeners(event?: string): EventEmitter

Parameters

  • event?: string optional

Returns

EventEmitter

public removeListener(event: string, listener: Function): EventEmitter

Parameters

  • event: string
  • listener: Function

Returns

EventEmitter

public send(buf: Buffer, offset: number, length: number, port: number, address: string, callback?: (error: Error, bytes: number) => void)

Parameters

  • buf: Buffer
  • offset: number
  • length: number
  • port: number
  • address: string
  • callback?: (error: Error, bytes: number) => void optional

public setBroadcast(flag: boolean)

Parameters

  • flag: boolean

public setMaxListeners(n: number)

Parameters

  • n: number

public setMulticastLoopback(flag: boolean)

Parameters

  • flag: boolean

public setMulticastTTL(ttl: number)

Parameters

  • ttl: number