Interface Connection

Hierarchy

Index

Properties

Methods

Properties

public address: { [key: string]: { address: string; port: number; }; }

(): { address: string; port: number; }

Returns

{ address: string; port: number; }

public headers: { [key: string]: string; }

(): string

Returns

string

public pathname: string

public prefix: string

public protocol: string

public readable: boolean

public readyState: number

public remoteAddress: string

public remotePort: number

public url: string

public writable: boolean

Methods

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

Parameters

  • event: string
  • listener: Function

Returns

EventEmitter

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

Parameters

  • event: string
  • listener: Function

Returns

EventEmitter

public close(code?: string, reason?: string): boolean

Parameters

  • code?: string optional
  • reason?: string optional

Returns

boolean

public destroy()

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

Parameters

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

Returns

boolean

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

Parameters

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

Returns

boolean

public end()

public end(buffer: Buffer, cb?: Function)

Parameters

  • buffer: Buffer
  • cb?: Function optional

public end(str: string, cb?: Function)

Parameters

  • str: string
  • cb?: Function optional

public end(str: string, encoding?: string, cb?: Function)

Parameters

  • str: string
  • encoding?: string optional
  • cb?: Function optional

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

Parameters

  • event: string

Returns

Array<Function>

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

Parameters

  • event: string

Returns

Array<Function>

public on(event: "'data'", listener: (message: string) => any): Connection

Parameters

  • event: "'data'"
  • listener: (message: string) => any

Returns

Connection

public on(event: "'close'", listener: () => void): Connection

Parameters

  • event: "'close'"
  • listener: () => void

Returns

Connection

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

Parameters

  • event: string
  • listener: Function

Returns

Connection

public once(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 pause()

public pipe(destination: T, options?: { end?: boolean; }): T

Parameters

  • destination: T
  • options?: { end?: boolean; } optional

Returns

T

public read(size?: number): any

Parameters

  • size?: number optional

Returns

any

public removeAllListeners(event?: string): EventEmitter

Parameters

  • event?: string optional

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 removeListener(event: string, listener: Function): EventEmitter

Parameters

  • event: string
  • listener: Function

Returns

EventEmitter

public resume()

public setEncoding(encoding: string)

Parameters

  • encoding: string

public setMaxListeners(n: number)

Parameters

  • n: number

public setMaxListeners(n: number)

Parameters

  • n: number

public unpipe(destination?: T)

Parameters

  • destination?: T optional

public unshift(chunk: string)

Parameters

  • chunk: string

public unshift(chunk: Buffer)

Parameters

public wrap(oldStream: ReadableStream): ReadableStream

Parameters

Returns

ReadableStream

public write(buffer: Buffer, cb?: Function): boolean

Parameters

  • buffer: Buffer
  • cb?: Function optional

Returns

boolean

public write(str: string, cb?: Function): boolean

Parameters

  • str: string
  • cb?: Function optional

Returns

boolean

public write(str: string, encoding?: string, cb?: Function): boolean

Parameters

  • str: string
  • encoding?: string optional
  • cb?: Function optional

Returns

boolean