Interface 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): any

Parameters

  • event: string
  • listener: Function

Returns

any

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

Parameters

  • multicastAddress: string
  • multicastInterface?: string optional

public bind(port: number, address?: string)

Parameters

  • port: number
  • address?: string optional

public close()

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

Parameters

  • multicastAddress: string
  • multicastInterface?: string optional

public emit(event: string, arg1?: any, arg2?: any)

Parameters

  • event: string
  • arg1?: any optional
  • arg2?: any optional

public listeners(event: string): Array<{ Function: any; }>

Parameters

  • event: string

Returns

Array<{ Function: any; }>

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

Parameters

  • event: string
  • listener: Function

Returns

any

public once(event: string, listener: Function)

Parameters

  • event: string
  • listener: Function

public removeAllListener(event: string)

Parameters

  • event: string

public removeListener(event: string, listener: Function)

Parameters

  • event: string
  • listener: Function

public send(buf: Buffer, offset: number, length: number, port: number, address: string, callback?: Function)

Parameters

  • buf: Buffer
  • offset: number
  • length: number
  • port: number
  • address: string
  • callback?: Function 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