Dynamic module net

Index

Variables

Classes

Functions

Variables

Socket: Socket

constructor(opts?: DuplexOptions): Duplex

Parameters

Returns

Duplex

public bufferSize: number

public bytesRead: number

public bytesWritten: number

public readable: boolean

public remoteAddress: string

public remotePort: number

public writable: boolean

public _read(size: number)

Parameters

  • size: number

public _write(data: Buffer, encoding: string, callback: Function)

Parameters

  • data: Buffer
  • encoding: string
  • callback: Function

public _write(data: string, encoding: string, callback: Function)

Parameters

  • data: string
  • encoding: string
  • callback: Function

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

Parameters

  • event: string
  • listener: Function

Returns

EventEmitter

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

Returns

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

public connect(port: number, host?: string, connectionListener?: Function)

Parameters

  • port: number
  • host?: string optional
  • connectionListener?: Function optional

public connect(path: string, connectionListener?: Function)

Parameters

  • path: string
  • connectionListener?: Function optional

public destroy()

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 end(data?: any, encoding?: string)

Parameters

  • data?: any optional
  • encoding?: string optional

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

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

Parameters

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

Returns

T

public push(chunk: any, encoding?: string): boolean

Parameters

  • chunk: any
  • encoding?: string optional

Returns

boolean

public read(size?: number): any

Parameters

  • size?: number optional

Returns

any

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 resume()

public setEncoding(encoding?: string)

Parameters

  • encoding?: string optional

public setKeepAlive(enable?: boolean, initialDelay?: number)

Parameters

  • enable?: boolean optional
  • initialDelay?: number optional

public setMaxListeners(n: number)

Parameters

  • n: number

public setNoDelay(noDelay?: boolean)

Parameters

  • noDelay?: boolean optional

public setTimeout(timeout: number, callback?: Function)

Parameters

  • timeout: number
  • callback?: Function optional

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): boolean

Parameters

Returns

boolean

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

public write(str: string, encoding?: string, fd?: string): boolean

Parameters

  • str: string
  • encoding?: string optional
  • fd?: string optional

Returns

boolean

public write(data: any, encoding?: string, callback?: Function)

Parameters

  • data: any
  • encoding?: string optional
  • callback?: Function optional

Functions

connect(options: { allowHalfOpen?: boolean; }, connectionListener?: Function): Socket

Parameters

  • options: { allowHalfOpen?: boolean; }
  • connectionListener?: Function optional

Returns

Socket

connect(port: number, host?: string, connectionListener?: Function): Socket

Parameters

  • port: number
  • host?: string optional
  • connectionListener?: Function optional

Returns

Socket

connect(path: string, connectionListener?: Function): Socket

Parameters

  • path: string
  • connectionListener?: Function optional

Returns

Socket

createConnection(options: { allowHalfOpen?: boolean; }, connectionListener?: Function): Socket

Parameters

  • options: { allowHalfOpen?: boolean; }
  • connectionListener?: Function optional

Returns

Socket

createConnection(port: number, host?: string, connectionListener?: Function): Socket

Parameters

  • port: number
  • host?: string optional
  • connectionListener?: Function optional

Returns

Socket

createConnection(path: string, connectionListener?: Function): Socket

Parameters

  • path: string
  • connectionListener?: Function optional

Returns

Socket

createServer(connectionListener?: (socket: "net".Socket) => void): Server

Parameters

  • connectionListener?: (socket: "net".Socket) => void optional

Returns

Server

createServer(options?: { allowHalfOpen?: boolean; }, connectionListener?: (socket: "net".Socket) => void): Server

Parameters

  • options?: { allowHalfOpen?: boolean; } optional
  • connectionListener?: (socket: "net".Socket) => void optional

Returns

Server

isIP(input: string): number

Parameters

  • input: string

Returns

number

isIPv4(input: string): boolean

Parameters

  • input: string

Returns

boolean

isIPv6(input: string): boolean

Parameters

  • input: string

Returns

boolean