Socket | typescript
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Implements

Index

Constructors

constructor

Properties

bufferSize

bufferSize: number

bytesRead

bytesRead: number

bytesWritten

bytesWritten: number

connecting

connecting: boolean

destroyed

destroyed: boolean

localAddress

localAddress: string

localPort

localPort: number

readable

readable: boolean

remoteAddress

remoteAddress: string

remoteFamily

remoteFamily: string

remotePort

remotePort: number

writable

writable: boolean

Static defaultMaxListeners

defaultMaxListeners: number

Methods

_read

  • _read(size: number): void
  • Parameters

    • size: number

    Returns void

_write

  • _write(chunk: any, encoding: string, callback: Function): void
  • Parameters

    • chunk: any
    • encoding: string
    • callback: Function

    Returns void

addListener

  • addListener(event: string, listener: Function): this
  • addListener(event: "close", listener: function): this
  • addListener(event: "connect", listener: function): this
  • addListener(event: "data", listener: function): this
  • addListener(event: "drain", listener: function): this
  • addListener(event: "end", listener: function): this
  • addListener(event: "error", listener: function): this
  • addListener(event: "lookup", listener: function): this
  • addListener(event: "timeout", listener: function): this
  • events.EventEmitter

    1. close
    2. connect
    3. data
    4. drain
    5. end
    6. error
    7. lookup
    8. timeout

    Parameters

    • event: string
    • listener: Function

    Returns this

  • Parameters

    • event: "close"
    • listener: function
        • (had_error: boolean): void
        • Parameters

          • had_error: boolean

          Returns void

    Returns this

  • Parameters

    • event: "connect"
    • listener: function
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "data"
    • listener: function

    Returns this

  • Parameters

    • event: "drain"
    • listener: function
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "end"
    • listener: function
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "error"
    • listener: function
        • (err: Error): void
        • Parameters

          • err: Error

          Returns void

    Returns this

  • Parameters

    • event: "lookup"
    • listener: function
        • (err: Error, address: string, family: string | number, host: string): void
        • Parameters

          • err: Error
          • address: string
          • family: string | number
          • host: string

          Returns void

    Returns this

  • Parameters

    • event: "timeout"
    • listener: function
        • (): void
        • Returns void

    Returns this

address

  • address(): object
  • Returns object

    • address: string
    • family: string
    • port: number

connect

  • connect(port: number, host?: string, connectionListener?: Function): void
  • connect(path: string, connectionListener?: Function): void
  • Parameters

    • port: number
    • Optional host: string
    • Optional connectionListener: Function

    Returns void

  • Parameters

    • path: string
    • Optional connectionListener: Function

    Returns void

destroy

  • destroy(): void
  • Returns void

emit

  • emit(event: string | symbol, ...args: any[]): boolean
  • emit(event: "close", had_error: boolean): boolean
  • emit(event: "connect"): boolean
  • emit(event: "data", data: Buffer): boolean
  • emit(event: "drain"): boolean
  • emit(event: "end"): boolean
  • emit(event: "error", err: Error): boolean
  • emit(event: "lookup", err: Error, address: string, family: string | number, host: string): boolean
  • emit(event: "timeout"): boolean
  • Parameters

    • event: string | symbol
    • Rest ...args: any[]

    Returns boolean

  • Parameters

    • event: "close"
    • had_error: boolean

    Returns boolean

  • Parameters

    • event: "connect"

    Returns boolean

  • Parameters

    Returns boolean

  • Parameters

    • event: "drain"

    Returns boolean

  • Parameters

    • event: "end"

    Returns boolean

  • Parameters

    • event: "error"
    • err: Error

    Returns boolean

  • Parameters

    • event: "lookup"
    • err: Error
    • address: string
    • family: string | number
    • host: string

    Returns boolean

  • Parameters

    • event: "timeout"

    Returns boolean

end

  • end(): void
  • end(buffer: Buffer, cb?: Function): void
  • end(str: string, cb?: Function): void
  • end(str: string, encoding?: string, cb?: Function): void
  • end(data?: any, encoding?: string): void
  • Returns void

  • Parameters

    • buffer: Buffer
    • Optional cb: Function

    Returns void

  • Parameters

    • str: string
    • Optional cb: Function

    Returns void

  • Parameters

    • str: string
    • Optional encoding: string
    • Optional cb: Function

    Returns void

  • Parameters

    • Optional data: any
    • Optional encoding: string

    Returns void

eventNames

  • eventNames(): (string | symbol)[]

getMaxListeners

  • getMaxListeners(): number

isPaused

  • isPaused(): boolean
  • Returns boolean

listenerCount

  • listenerCount(type: string | symbol): number

listeners

  • listeners(event: string | symbol): Function[]
  • Parameters

    • event: string | symbol

    Returns Function[]

on

  • on(event: string, listener: Function): this
  • on(event: "close", listener: function): this
  • on(event: "connect", listener: function): this
  • on(event: "data", listener: function): this
  • on(event: "drain", listener: function): this
  • on(event: "end", listener: function): this
  • on(event: "error", listener: function): this
  • on(event: "lookup", listener: function): this
  • on(event: "timeout", listener: function): this
  • Parameters

    • event: string
    • listener: Function

    Returns this

  • Parameters

    • event: "close"
    • listener: function
        • (had_error: boolean): void
        • Parameters

          • had_error: boolean

          Returns void

    Returns this

  • Parameters

    • event: "connect"
    • listener: function
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "data"
    • listener: function

    Returns this

  • Parameters

    • event: "drain"
    • listener: function
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "end"
    • listener: function
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "error"
    • listener: function
        • (err: Error): void
        • Parameters

          • err: Error

          Returns void

    Returns this

  • Parameters

    • event: "lookup"
    • listener: function
        • (err: Error, address: string, family: string | number, host: string): void
        • Parameters

          • err: Error
          • address: string
          • family: string | number
          • host: string

          Returns void

    Returns this

  • Parameters

    • event: "timeout"
    • listener: function
        • (): void
        • Returns void

    Returns this

once

  • once(event: string, listener: Function): this
  • once(event: "close", listener: function): this
  • once(event: "connect", listener: function): this
  • once(event: "data", listener: function): this
  • once(event: "drain", listener: function): this
  • once(event: "end", listener: function): this
  • once(event: "error", listener: function): this
  • once(event: "lookup", listener: function): this
  • once(event: "timeout", listener: function): this
  • Parameters

    • event: string
    • listener: Function

    Returns this

  • Parameters

    • event: "close"
    • listener: function
        • (had_error: boolean): void
        • Parameters

          • had_error: boolean

          Returns void

    Returns this

  • Parameters

    • event: "connect"
    • listener: function
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "data"
    • listener: function

    Returns this

  • Parameters

    • event: "drain"
    • listener: function
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "end"
    • listener: function
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "error"
    • listener: function
        • (err: Error): void
        • Parameters

          • err: Error

          Returns void

    Returns this

  • Parameters

    • event: "lookup"
    • listener: function
        • (err: Error, address: string, family: string | number, host: string): void
        • Parameters

          • err: Error
          • address: string
          • family: string | number
          • host: string

          Returns void

    Returns this

  • Parameters

    • event: "timeout"
    • listener: function
        • (): void
        • Returns void

    Returns this

pause

  • pause(): this
  • Returns this

pipe

  • pipe<T>(destination: T, options?: object): T
  • Type parameters

    Parameters

    • destination: T
    • Optional options: object
      • Optional end?: boolean

    Returns T

prependListener

  • prependListener(event: string, listener: Function): this
  • prependListener(event: "close", listener: function): this
  • prependListener(event: "connect", listener: function): this
  • prependListener(event: "data", listener: function): this
  • prependListener(event: "drain", listener: function): this
  • prependListener(event: "end", listener: function): this
  • prependListener(event: "error", listener: function): this
  • prependListener(event: "lookup", listener: function): this
  • prependListener(event: "timeout", listener: function): this
  • Parameters

    • event: string
    • listener: Function

    Returns this

  • Parameters

    • event: "close"
    • listener: function
        • (had_error: boolean): void
        • Parameters

          • had_error: boolean

          Returns void

    Returns this

  • Parameters

    • event: "connect"
    • listener: function
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "data"
    • listener: function

    Returns this

  • Parameters

    • event: "drain"
    • listener: function
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "end"
    • listener: function
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "error"
    • listener: function
        • (err: Error): void
        • Parameters

          • err: Error

          Returns void

    Returns this

  • Parameters

    • event: "lookup"
    • listener: function
        • (err: Error, address: string, family: string | number, host: string): void
        • Parameters

          • err: Error
          • address: string
          • family: string | number
          • host: string

          Returns void

    Returns this

  • Parameters

    • event: "timeout"
    • listener: function
        • (): void
        • Returns void

    Returns this

prependOnceListener

  • prependOnceListener(event: string, listener: Function): this
  • prependOnceListener(event: "close", listener: function): this
  • prependOnceListener(event: "connect", listener: function): this
  • prependOnceListener(event: "data", listener: function): this
  • prependOnceListener(event: "drain", listener: function): this
  • prependOnceListener(event: "end", listener: function): this
  • prependOnceListener(event: "error", listener: function): this
  • prependOnceListener(event: "lookup", listener: function): this
  • prependOnceListener(event: "timeout", listener: function): this
  • Parameters

    • event: string
    • listener: Function

    Returns this

  • Parameters

    • event: "close"
    • listener: function
        • (had_error: boolean): void
        • Parameters

          • had_error: boolean

          Returns void

    Returns this

  • Parameters

    • event: "connect"
    • listener: function
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "data"
    • listener: function

    Returns this

  • Parameters

    • event: "drain"
    • listener: function
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "end"
    • listener: function
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "error"
    • listener: function
        • (err: Error): void
        • Parameters

          • err: Error

          Returns void

    Returns this

  • Parameters

    • event: "lookup"
    • listener: function
        • (err: Error, address: string, family: string | number, host: string): void
        • Parameters

          • err: Error
          • address: string
          • family: string | number
          • host: string

          Returns void

    Returns this

  • Parameters

    • event: "timeout"
    • listener: function
        • (): void
        • Returns void

    Returns this

push

  • push(chunk: any, encoding?: string): boolean
  • Parameters

    • chunk: any
    • Optional encoding: string

    Returns boolean

read

  • read(size?: number): any
  • Parameters

    • Optional size: number

    Returns any

ref

  • ref(): void
  • Returns void

removeAllListeners

  • removeAllListeners(event?: string | symbol): this

removeListener

  • removeListener(event: string, listener: Function): this
  • removeListener(event: "close", listener: function): this
  • removeListener(event: "data", listener: function): this
  • removeListener(event: "end", listener: function): this
  • removeListener(event: "readable", listener: function): this
  • removeListener(event: "error", listener: function): this
  • Parameters

    • event: string
    • listener: Function

    Returns this

  • Parameters

    • event: "close"
    • listener: function
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "data"
    • listener: function
        • (chunk: Buffer | string): void
        • Parameters

          Returns void

    Returns this

  • Parameters

    • event: "end"
    • listener: function
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "readable"
    • listener: function
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "error"
    • listener: function
        • (err: Error): void
        • Parameters

          • err: Error

          Returns void

    Returns this

resume

  • resume(): this
  • Returns this

setDefaultEncoding

  • setDefaultEncoding(encoding: string): this
  • Parameters

    • encoding: string

    Returns this

setEncoding

  • setEncoding(encoding?: string): void
  • Parameters

    • Optional encoding: string

    Returns void

setKeepAlive

  • setKeepAlive(enable?: boolean, initialDelay?: number): void
  • Parameters

    • Optional enable: boolean
    • Optional initialDelay: number

    Returns void

setMaxListeners

  • setMaxListeners(n: number): this

setNoDelay

  • setNoDelay(noDelay?: boolean): void
  • Parameters

    • Optional noDelay: boolean

    Returns void

setTimeout

  • setTimeout(timeout: number, callback?: Function): void
  • Parameters

    • timeout: number
    • Optional callback: Function

    Returns void

unpipe

  • unpipe<T>(destination?: T): void
  • Type parameters

    Parameters

    • Optional destination: T

    Returns void

unref

  • unref(): void
  • Returns void

unshift

  • unshift(chunk: any): void
  • Parameters

    • chunk: any

    Returns void

wrap

  • Parameters

    Returns Readable

write

  • write(buffer: Buffer): boolean
  • write(buffer: Buffer, cb?: Function): boolean
  • write(str: string, cb?: Function): boolean
  • write(str: string, encoding?: string, cb?: Function): boolean
  • write(str: string, encoding?: string, fd?: string): boolean
  • write(data: any, encoding?: string, callback?: Function): void
  • Parameters

    Returns boolean

  • Parameters

    • buffer: Buffer
    • Optional cb: Function

    Returns boolean

  • Parameters

    • str: string
    • Optional cb: Function

    Returns boolean

  • Parameters

    • str: string
    • Optional encoding: string
    • Optional cb: Function

    Returns boolean

  • Parameters

    • str: string
    • Optional encoding: string
    • Optional fd: string

    Returns boolean

  • Parameters

    • data: any
    • Optional encoding: string
    • Optional callback: Function

    Returns void

Static listenerCount

  • listenerCount(emitter: EventEmitter, event: string | symbol): number
  • Parameters

    Returns number

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc