INodeSocket interface

Represents a Socket from the net module in Node.js. This interface supports the framework and is not intended to be called directly for your code.

Properties

bufferSize
bytesRead
bytesWritten
connecting
destroyed
localAddress
localPort
readable
readableFlowing
readableHighWaterMark
readableLength
writable
writableHighWaterMark
writableLength

Methods

addListener("close", () => void)
addListener("data", (chunk: any) => void)
addListener("end", () => void)
addListener("error", (err: Error) => void)
addListener("readable", () => void)
addListener(string | symbol, (args: any[]) => void)
address()
connect(any, () => void)
connect(number, () => void)
connect(number, string, () => void)
connect(string, () => void)
cork()
destroy(Error)
emit("close")
emit("data", any)
emit("end")
emit("error", Error)
emit("readable")
emit(string | symbol, any[])
end(() => void)
end(any, () => void)
end(any, string, () => void)
eventNames()
getMaxListeners()
isPaused()
listenerCount(string | symbol)
listeners(string | symbol)
off(string | symbol, (args: any[]) => void)
on("close", (had_error: boolean) => void)
on("connect", () => void)
on("data", (data: INodeBuffer) => void)
on("end", () => void)
on("error", (err: Error) => void)
on(string, (args: any[]) => void)
once("close", () => void)
once("data", (chunk: any) => void)
once("end", () => void)
once("error", (err: Error) => void)
once("readable", () => void)
once(string | symbol, (args: any[]) => void)
pause()
pipe<T>(T, { end?: boolean })
prependListener("close", () => void)
prependListener("data", (chunk: any) => void)
prependListener("end", () => void)
prependListener("error", (err: Error) => void)
prependListener("readable", () => void)
prependListener(string | symbol, (args: any[]) => void)
prependOnceListener("close", () => void)
prependOnceListener("data", (chunk: any) => void)
prependOnceListener("end", () => void)
prependOnceListener("error", (err: Error) => void)
prependOnceListener("readable", () => void)
prependOnceListener(string | symbol, (args: any[]) => void)
push(any, string)
rawListeners(string | symbol)
read(number)
ref()
removeAllListeners(string | symbol)
removeListener(string | symbol, (args: any[]) => void)
resume()
setDefaultEncoding(string)
setEncoding(string)
setKeepAlive(boolean, number)
setMaxListeners(number)
setNoDelay(boolean)
setTimeout(number, () => void)
uncork()
unpipe(any)
unref()
unshift(any)
wrap(any)
write(any, (error: Error | null | undefined) => void)
write(any, string, (error: Error | null | undefined) => void)
write(any, string, Function)
write(string, Function)
write(string, string, Function)
write(string, string, string)
write(ValidBuffer)
write(ValidBuffer, (err?: Error) => void)

Property Details

bufferSize

bufferSize: number

Property Value

number

bytesRead

bytesRead: number

Property Value

number

bytesWritten

bytesWritten: number

Property Value

number

connecting

connecting: boolean

Property Value

boolean

destroyed

destroyed: boolean

Property Value

boolean

localAddress

localAddress: string

Property Value

string

localPort

localPort: number

Property Value

number

readable

readable: boolean

Property Value

boolean

readableFlowing

readableFlowing: boolean | null

Property Value

boolean | null

readableHighWaterMark

readableHighWaterMark: number

Property Value

number

readableLength

readableLength: number

Property Value

number

writable

writable: boolean

Property Value

boolean

writableHighWaterMark

writableHighWaterMark: number

Property Value

number

writableLength

writableLength: number

Property Value

number

Method Details

addListener("close", () => void)

function addListener(event: "close", listener: () => void): this

Parameters

event

"close"

listener

() => void

Returns

this

addListener("data", (chunk: any) => void)

function addListener(event: "data", listener: (chunk: any) => void): this

Parameters

event

"data"

listener

(chunk: any) => void

Returns

this

addListener("end", () => void)

function addListener(event: "end", listener: () => void): this

Parameters

event

"end"

listener

() => void

Returns

this

addListener("error", (err: Error) => void)

function addListener(event: "error", listener: (err: Error) => void): this

Parameters

event

"error"

listener

(err: Error) => void

Returns

this

addListener("readable", () => void)

function addListener(event: "readable", listener: () => void): this

Parameters

event

"readable"

listener

() => void

Returns

this

addListener(string | symbol, (args: any[]) => void)

function addListener(event: string | symbol, listener: (args: any[]) => void): this

Parameters

event

string | symbol

listener

(args: any[]) => void

Returns

this

address()

function address(): AddressInfo | string

Returns

AddressInfo | string

connect(any, () => void)

function connect(options: any, connectionListener?: () => void): any

Parameters

options

any

connectionListener

() => void

Returns

any

connect(number, () => void)

function connect(port: number, connectionListener?: () => void): any

Parameters

port

number

connectionListener

() => void

Returns

any

connect(number, string, () => void)

function connect(port: number, host: string, connectionListener?: () => void): any

Parameters

port

number

host

string

connectionListener

() => void

Returns

any

connect(string, () => void)

function connect(path: string, connectionListener?: () => void): any

Parameters

path

string

connectionListener

() => void

Returns

any

cork()

function cork()

destroy(Error)

function destroy(error?: Error)

Parameters

error

Error

emit("close")

function emit(event: "close"): boolean

Parameters

event

"close"

Returns

boolean

emit("data", any)

function emit(event: "data", chunk: any): boolean

Parameters

event

"data"

chunk

any

Returns

boolean

emit("end")

function emit(event: "end"): boolean

Parameters

event

"end"

Returns

boolean

emit("error", Error)

function emit(event: "error", err: Error): boolean

Parameters

event

"error"

err

Error

Returns

boolean

emit("readable")

function emit(event: "readable"): boolean

Parameters

event

"readable"

Returns

boolean

emit(string | symbol, any[])

function emit(event: string | symbol, args: any[]): boolean

Parameters

event

string | symbol

args

any[]

Returns

boolean

end(() => void)

function end(cb?: () => void)

Parameters

cb

() => void

end(any, () => void)

function end(chunk: any, cb?: () => void)

Parameters

chunk

any

cb

() => void

end(any, string, () => void)

function end(chunk: any, encoding?: string, cb?: () => void)

Parameters

chunk

any

encoding

string

cb

() => void

eventNames()

function eventNames(): Array<string | symbol>

Returns

Array<string | symbol>

getMaxListeners()

function getMaxListeners(): number

Returns

number

isPaused()

function isPaused(): boolean

Returns

boolean

listenerCount(string | symbol)

function listenerCount(type: string | symbol): number

Parameters

type

string | symbol

Returns

number

listeners(string | symbol)

function listeners(event: string | symbol): Function[]

Parameters

event

string | symbol

Returns

Function[]

off(string | symbol, (args: any[]) => void)

function off(event: string | symbol, listener: (args: any[]) => void): this

Parameters

event

string | symbol

listener

(args: any[]) => void

Returns

this

on("close", (had_error: boolean) => void)

function on(event: "close", listener: (had_error: boolean) => void): this

Parameters

event

"close"

listener

(had_error: boolean) => void

Returns

this

on("connect", () => void)

function on(event: "connect", listener: () => void): this

Parameters

event

"connect"

listener

() => void

Returns

this

on("data", (data: INodeBuffer) => void)

function on(event: "data", listener: (data: INodeBuffer) => void): this

Parameters

event

"data"

listener

(data: INodeBuffer) => void

Returns

this

on("end", () => void)

function on(event: "end", listener: () => void): this

Parameters

event

"end"

listener

() => void

Returns

this

on("error", (err: Error) => void)

function on(event: "error", listener: (err: Error) => void): this

Parameters

event

"error"

listener

(err: Error) => void

Returns

this

on(string, (args: any[]) => void)

function on(event: string, listener: (args: any[]) => void): this

Parameters

event

string

listener

(args: any[]) => void

Returns

this

once("close", () => void)

function once(event: "close", listener: () => void): this

Parameters

event

"close"

listener

() => void

Returns

this

once("data", (chunk: any) => void)

function once(event: "data", listener: (chunk: any) => void): this

Parameters

event

"data"

listener

(chunk: any) => void

Returns

this

once("end", () => void)

function once(event: "end", listener: () => void): this

Parameters

event

"end"

listener

() => void

Returns

this

once("error", (err: Error) => void)

function once(event: "error", listener: (err: Error) => void): this

Parameters

event

"error"

listener

(err: Error) => void

Returns

this

once("readable", () => void)

function once(event: "readable", listener: () => void): this

Parameters

event

"readable"

listener

() => void

Returns

this

once(string | symbol, (args: any[]) => void)

function once(event: string | symbol, listener: (args: any[]) => void): this

Parameters

event

string | symbol

listener

(args: any[]) => void

Returns

this

pause()

function pause(): this

Returns

this

pipe<T>(T, { end?: boolean })

function pipe<T>(destination: T, options?: { end?: boolean }): T

Parameters

destination

T

options

{ end?: boolean }

Returns

T

prependListener("close", () => void)

function prependListener(event: "close", listener: () => void): this

Parameters

event

"close"

listener

() => void

Returns

this

prependListener("data", (chunk: any) => void)

function prependListener(event: "data", listener: (chunk: any) => void): this

Parameters

event

"data"

listener

(chunk: any) => void

Returns

this

prependListener("end", () => void)

function prependListener(event: "end", listener: () => void): this

Parameters

event

"end"

listener

() => void

Returns

this

prependListener("error", (err: Error) => void)

function prependListener(event: "error", listener: (err: Error) => void): this

Parameters

event

"error"

listener

(err: Error) => void

Returns

this

prependListener("readable", () => void)

function prependListener(event: "readable", listener: () => void): this

Parameters

event

"readable"

listener

() => void

Returns

this

prependListener(string | symbol, (args: any[]) => void)

function prependListener(event: string | symbol, listener: (args: any[]) => void): this

Parameters

event

string | symbol

listener

(args: any[]) => void

Returns

this

prependOnceListener("close", () => void)

function prependOnceListener(event: "close", listener: () => void): this

Parameters

event

"close"

listener

() => void

Returns

this

prependOnceListener("data", (chunk: any) => void)

function prependOnceListener(event: "data", listener: (chunk: any) => void): this

Parameters

event

"data"

listener

(chunk: any) => void

Returns

this

prependOnceListener("end", () => void)

function prependOnceListener(event: "end", listener: () => void): this

Parameters

event

"end"

listener

() => void

Returns

this

prependOnceListener("error", (err: Error) => void)

function prependOnceListener(event: "error", listener: (err: Error) => void): this

Parameters

event

"error"

listener

(err: Error) => void

Returns

this

prependOnceListener("readable", () => void)

function prependOnceListener(event: "readable", listener: () => void): this

Parameters

event

"readable"

listener

() => void

Returns

this

prependOnceListener(string | symbol, (args: any[]) => void)

function prependOnceListener(event: string | symbol, listener: (args: any[]) => void): this

Parameters

event

string | symbol

listener

(args: any[]) => void

Returns

this

push(any, string)

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

Parameters

chunk

any

encoding

string

Returns

boolean

rawListeners(string | symbol)

function rawListeners(event: string | symbol): Function[]

Parameters

event

string | symbol

Returns

Function[]

read(number)

function read(size?: number): any

Parameters

size

number

Returns

any

ref()

function ref(): any

Returns

any

removeAllListeners(string | symbol)

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

Parameters

event

string | symbol

Returns

this

removeListener(string | symbol, (args: any[]) => void)

function removeListener(event: string | symbol, listener: (args: any[]) => void): this

Parameters

event

string | symbol

listener

(args: any[]) => void

Returns

this

resume()

function resume(): this

Returns

this

setDefaultEncoding(string)

function setDefaultEncoding(encoding: string): this

Parameters

encoding

string

Returns

this

setEncoding(string)

function setEncoding(encoding: string): this

Parameters

encoding

string

Returns

this

setKeepAlive(boolean, number)

function setKeepAlive(enable?: boolean, initialDelay?: number): this

Parameters

enable

boolean

initialDelay

number

Returns

this

setMaxListeners(number)

function setMaxListeners(n: number): this

Parameters

n

number

Returns

this

setNoDelay(boolean)

function setNoDelay(noDelay?: boolean): this

Parameters

noDelay

boolean

Returns

this

setTimeout(number, () => void)

function setTimeout(timeout: number, callback?: () => void): this

Parameters

timeout

number

callback

() => void

Returns

this

uncork()

function uncork()

unpipe(any)

function unpipe(destination?: any): this

Parameters

destination

any

Returns

this

unref()

function unref(): any

Returns

any

unshift(any)

function unshift(chunk: any)

Parameters

chunk

any

wrap(any)

function wrap(oldStream: any): this

Parameters

oldStream

any

Returns

this

write(any, (error: Error | null | undefined) => void)

function write(chunk: any, cb?: (error: Error | null | undefined) => void): boolean

Parameters

chunk

any

cb

(error: Error | null | undefined) => void

Returns

boolean

write(any, string, (error: Error | null | undefined) => void)

function write(chunk: any, encoding?: string, cb?: (error: Error | null | undefined) => void): boolean

Parameters

chunk

any

encoding

string

cb

(error: Error | null | undefined) => void

Returns

boolean

write(any, string, Function)

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

Parameters

data

any

encoding

string

callback

Function

write(string, Function)

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

Parameters

str

string

cb

Function

Returns

boolean

write(string, string, Function)

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

Parameters

str

string

encoding

string

cb

Function

Returns

boolean

write(string, string, string)

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

Parameters

str

string

encoding

string

fd

string

Returns

boolean

write(ValidBuffer)

function write(buffer: ValidBuffer): boolean

Parameters

buffer
ValidBuffer

Returns

boolean

write(ValidBuffer, (err?: Error) => void)

function write(buffer: ValidBuffer, cb?: (err?: Error) => void): boolean

Parameters

buffer
ValidBuffer
cb

(err?: Error) => void

Returns

boolean