INodeSocket interface

Représente un socket du net module dans Node.js. Cette interface prend en charge le framework et n’est pas destinée à être appelée directement pour votre code.

Propriétés

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

Méthodes

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)

Détails de la propriété

bufferSize

bufferSize: number

Valeur de propriété

number

bytesRead

bytesRead: number

Valeur de propriété

number

bytesWritten

bytesWritten: number

Valeur de propriété

number

connecting

connecting: boolean

Valeur de propriété

boolean

destroyed

destroyed: boolean

Valeur de propriété

boolean

localAddress

localAddress: string

Valeur de propriété

string

localPort

localPort: number

Valeur de propriété

number

readable

readable: boolean

Valeur de propriété

boolean

readableFlowing

readableFlowing: boolean | null

Valeur de propriété

boolean | null

readableHighWaterMark

readableHighWaterMark: number

Valeur de propriété

number

readableLength

readableLength: number

Valeur de propriété

number

writable

writable: boolean

Valeur de propriété

boolean

writableHighWaterMark

writableHighWaterMark: number

Valeur de propriété

number

writableLength

writableLength: number

Valeur de propriété

number

Détails de la méthode

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

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

Paramètres

event

"close"

listener

() => void

Retours

this

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

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

Paramètres

event

"data"

listener

(chunk: any) => void

Retours

this

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

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

Paramètres

event

"end"

listener

() => void

Retours

this

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

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

Paramètres

event

"error"

listener

(err: Error) => void

Retours

this

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

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

Paramètres

event

"readable"

listener

() => void

Retours

this

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

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

Paramètres

event

string | symbol

listener

(args: any[]) => void

Retours

this

address()

function address(): AddressInfo | string

Retours

AddressInfo | string

connect(any, () => void)

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

Paramètres

options

any

connectionListener

() => void

Retours

any

connect(number, () => void)

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

Paramètres

port

number

connectionListener

() => void

Retours

any

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

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

Paramètres

port

number

host

string

connectionListener

() => void

Retours

any

connect(string, () => void)

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

Paramètres

path

string

connectionListener

() => void

Retours

any

cork()

function cork()

destroy(Error)

function destroy(error?: Error)

Paramètres

error

Error

emit("close")

function emit(event: "close"): boolean

Paramètres

event

"close"

Retours

boolean

emit("data", any)

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

Paramètres

event

"data"

chunk

any

Retours

boolean

emit("end")

function emit(event: "end"): boolean

Paramètres

event

"end"

Retours

boolean

emit("error", Error)

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

Paramètres

event

"error"

err

Error

Retours

boolean

emit("readable")

function emit(event: "readable"): boolean

Paramètres

event

"readable"

Retours

boolean

emit(string | symbol, any[])

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

Paramètres

event

string | symbol

args

any[]

Retours

boolean

end(() => void)

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

Paramètres

cb

() => void

end(any, () => void)

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

Paramètres

chunk

any

cb

() => void

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

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

Paramètres

chunk

any

encoding

string

cb

() => void

eventNames()

function eventNames(): Array<string | symbol>

Retours

Array<string | symbol>

getMaxListeners()

function getMaxListeners(): number

Retours

number

isPaused()

function isPaused(): boolean

Retours

boolean

listenerCount(string | symbol)

function listenerCount(type: string | symbol): number

Paramètres

type

string | symbol

Retours

number

listeners(string | symbol)

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

Paramètres

event

string | symbol

Retours

Function[]

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

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

Paramètres

event

string | symbol

listener

(args: any[]) => void

Retours

this

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

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

Paramètres

event

"close"

listener

(had_error: boolean) => void

Retours

this

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

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

Paramètres

event

"connect"

listener

() => void

Retours

this

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

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

Paramètres

event

"data"

listener

(data: INodeBuffer) => void

Retours

this

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

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

Paramètres

event

"end"

listener

() => void

Retours

this

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

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

Paramètres

event

"error"

listener

(err: Error) => void

Retours

this

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

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

Paramètres

event

string

listener

(args: any[]) => void

Retours

this

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

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

Paramètres

event

"close"

listener

() => void

Retours

this

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

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

Paramètres

event

"data"

listener

(chunk: any) => void

Retours

this

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

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

Paramètres

event

"end"

listener

() => void

Retours

this

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

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

Paramètres

event

"error"

listener

(err: Error) => void

Retours

this

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

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

Paramètres

event

"readable"

listener

() => void

Retours

this

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

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

Paramètres

event

string | symbol

listener

(args: any[]) => void

Retours

this

pause()

function pause(): this

Retours

this

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

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

Paramètres

destination

T

options

{ end?: boolean }

Retours

T

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

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

Paramètres

event

"close"

listener

() => void

Retours

this

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

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

Paramètres

event

"data"

listener

(chunk: any) => void

Retours

this

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

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

Paramètres

event

"end"

listener

() => void

Retours

this

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

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

Paramètres

event

"error"

listener

(err: Error) => void

Retours

this

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

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

Paramètres

event

"readable"

listener

() => void

Retours

this

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

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

Paramètres

event

string | symbol

listener

(args: any[]) => void

Retours

this

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

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

Paramètres

event

"close"

listener

() => void

Retours

this

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

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

Paramètres

event

"data"

listener

(chunk: any) => void

Retours

this

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

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

Paramètres

event

"end"

listener

() => void

Retours

this

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

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

Paramètres

event

"error"

listener

(err: Error) => void

Retours

this

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

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

Paramètres

event

"readable"

listener

() => void

Retours

this

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

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

Paramètres

event

string | symbol

listener

(args: any[]) => void

Retours

this

push(any, string)

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

Paramètres

chunk

any

encoding

string

Retours

boolean

rawListeners(string | symbol)

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

Paramètres

event

string | symbol

Retours

Function[]

read(number)

function read(size?: number): any

Paramètres

size

number

Retours

any

ref()

function ref(): any

Retours

any

removeAllListeners(string | symbol)

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

Paramètres

event

string | symbol

Retours

this

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

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

Paramètres

event

string | symbol

listener

(args: any[]) => void

Retours

this

resume()

function resume(): this

Retours

this

setDefaultEncoding(string)

function setDefaultEncoding(encoding: string): this

Paramètres

encoding

string

Retours

this

setEncoding(string)

function setEncoding(encoding: string): this

Paramètres

encoding

string

Retours

this

setKeepAlive(boolean, number)

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

Paramètres

enable

boolean

initialDelay

number

Retours

this

setMaxListeners(number)

function setMaxListeners(n: number): this

Paramètres

n

number

Retours

this

setNoDelay(boolean)

function setNoDelay(noDelay?: boolean): this

Paramètres

noDelay

boolean

Retours

this

setTimeout(number, () => void)

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

Paramètres

timeout

number

callback

() => void

Retours

this

uncork()

function uncork()

unpipe(any)

function unpipe(destination?: any): this

Paramètres

destination

any

Retours

this

unref()

function unref(): any

Retours

any

unshift(any)

function unshift(chunk: any)

Paramètres

chunk

any

wrap(any)

function wrap(oldStream: any): this

Paramètres

oldStream

any

Retours

this

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

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

Paramètres

chunk

any

cb

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

Retours

boolean

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

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

Paramètres

chunk

any

encoding

string

cb

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

Retours

boolean

write(any, string, Function)

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

Paramètres

data

any

encoding

string

callback

Function

write(string, Function)

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

Paramètres

str

string

cb

Function

Retours

boolean

write(string, string, Function)

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

Paramètres

str

string

encoding

string

cb

Function

Retours

boolean

write(string, string, string)

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

Paramètres

str

string

encoding

string

fd

string

Retours

boolean

write(ValidBuffer)

function write(buffer: ValidBuffer): boolean

Paramètres

buffer
ValidBuffer

Retours

boolean

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

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

Paramètres

buffer
ValidBuffer
cb

(err?: Error) => void

Retours

boolean