Compartir a través de


INodeSocket interface

Representa un socket del módulo net en Node.js. Esta interfaz admite el marco y no está pensado para llamarse directamente para el código.

Propiedades

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

Métodos

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)

Detalles de las propiedades

bufferSize

bufferSize: number

Valor de propiedad

number

bytesRead

bytesRead: number

Valor de propiedad

number

bytesWritten

bytesWritten: number

Valor de propiedad

number

connecting

connecting: boolean

Valor de propiedad

boolean

destroyed

destroyed: boolean

Valor de propiedad

boolean

localAddress

localAddress: string

Valor de propiedad

string

localPort

localPort: number

Valor de propiedad

number

readable

readable: boolean

Valor de propiedad

boolean

readableFlowing

readableFlowing: boolean | null

Valor de propiedad

boolean | null

readableHighWaterMark

readableHighWaterMark: number

Valor de propiedad

number

readableLength

readableLength: number

Valor de propiedad

number

writable

writable: boolean

Valor de propiedad

boolean

writableHighWaterMark

writableHighWaterMark: number

Valor de propiedad

number

writableLength

writableLength: number

Valor de propiedad

number

Detalles del método

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

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

Parámetros

event

"close"

listener

() => void

Devoluciones

this

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

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

Parámetros

event

"data"

listener

(chunk: any) => void

Devoluciones

this

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

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

Parámetros

event

"end"

listener

() => void

Devoluciones

this

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

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

Parámetros

event

"error"

listener

(err: Error) => void

Devoluciones

this

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

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

Parámetros

event

"readable"

listener

() => void

Devoluciones

this

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

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

Parámetros

event

string | symbol

listener

(args: any[]) => void

Devoluciones

this

address()

function address(): AddressInfo | string

Devoluciones

AddressInfo | string

connect(any, () => void)

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

Parámetros

options

any

connectionListener

() => void

Devoluciones

any

connect(number, () => void)

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

Parámetros

port

number

connectionListener

() => void

Devoluciones

any

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

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

Parámetros

port

number

host

string

connectionListener

() => void

Devoluciones

any

connect(string, () => void)

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

Parámetros

path

string

connectionListener

() => void

Devoluciones

any

cork()

function cork()

destroy(Error)

function destroy(error?: Error)

Parámetros

error

Error

emit("close")

function emit(event: "close"): boolean

Parámetros

event

"close"

Devoluciones

boolean

emit("data", any)

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

Parámetros

event

"data"

chunk

any

Devoluciones

boolean

emit("end")

function emit(event: "end"): boolean

Parámetros

event

"end"

Devoluciones

boolean

emit("error", Error)

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

Parámetros

event

"error"

err

Error

Devoluciones

boolean

emit("readable")

function emit(event: "readable"): boolean

Parámetros

event

"readable"

Devoluciones

boolean

emit(string | symbol, any[])

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

Parámetros

event

string | symbol

args

any[]

Devoluciones

boolean

end(() => void)

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

Parámetros

cb

() => void

end(any, () => void)

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

Parámetros

chunk

any

cb

() => void

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

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

Parámetros

chunk

any

encoding

string

cb

() => void

eventNames()

function eventNames(): Array<string | symbol>

Devoluciones

Array<string | symbol>

getMaxListeners()

function getMaxListeners(): number

Devoluciones

number

isPaused()

function isPaused(): boolean

Devoluciones

boolean

listenerCount(string | symbol)

function listenerCount(type: string | symbol): number

Parámetros

type

string | symbol

Devoluciones

number

listeners(string | symbol)

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

Parámetros

event

string | symbol

Devoluciones

Function[]

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

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

Parámetros

event

string | symbol

listener

(args: any[]) => void

Devoluciones

this

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

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

Parámetros

event

"close"

listener

(had_error: boolean) => void

Devoluciones

this

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

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

Parámetros

event

"connect"

listener

() => void

Devoluciones

this

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

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

Parámetros

event

"data"

listener

(data: INodeBuffer) => void

Devoluciones

this

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

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

Parámetros

event

"end"

listener

() => void

Devoluciones

this

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

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

Parámetros

event

"error"

listener

(err: Error) => void

Devoluciones

this

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

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

Parámetros

event

string

listener

(args: any[]) => void

Devoluciones

this

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

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

Parámetros

event

"close"

listener

() => void

Devoluciones

this

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

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

Parámetros

event

"data"

listener

(chunk: any) => void

Devoluciones

this

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

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

Parámetros

event

"end"

listener

() => void

Devoluciones

this

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

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

Parámetros

event

"error"

listener

(err: Error) => void

Devoluciones

this

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

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

Parámetros

event

"readable"

listener

() => void

Devoluciones

this

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

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

Parámetros

event

string | symbol

listener

(args: any[]) => void

Devoluciones

this

pause()

function pause(): this

Devoluciones

this

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

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

Parámetros

destination

T

options

{ end?: boolean }

Devoluciones

T

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

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

Parámetros

event

"close"

listener

() => void

Devoluciones

this

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

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

Parámetros

event

"data"

listener

(chunk: any) => void

Devoluciones

this

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

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

Parámetros

event

"end"

listener

() => void

Devoluciones

this

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

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

Parámetros

event

"error"

listener

(err: Error) => void

Devoluciones

this

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

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

Parámetros

event

"readable"

listener

() => void

Devoluciones

this

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

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

Parámetros

event

string | symbol

listener

(args: any[]) => void

Devoluciones

this

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

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

Parámetros

event

"close"

listener

() => void

Devoluciones

this

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

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

Parámetros

event

"data"

listener

(chunk: any) => void

Devoluciones

this

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

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

Parámetros

event

"end"

listener

() => void

Devoluciones

this

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

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

Parámetros

event

"error"

listener

(err: Error) => void

Devoluciones

this

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

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

Parámetros

event

"readable"

listener

() => void

Devoluciones

this

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

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

Parámetros

event

string | symbol

listener

(args: any[]) => void

Devoluciones

this

push(any, string)

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

Parámetros

chunk

any

encoding

string

Devoluciones

boolean

rawListeners(string | symbol)

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

Parámetros

event

string | symbol

Devoluciones

Function[]

read(number)

function read(size?: number): any

Parámetros

size

number

Devoluciones

any

ref()

function ref(): any

Devoluciones

any

removeAllListeners(string | symbol)

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

Parámetros

event

string | symbol

Devoluciones

this

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

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

Parámetros

event

string | symbol

listener

(args: any[]) => void

Devoluciones

this

resume()

function resume(): this

Devoluciones

this

setDefaultEncoding(string)

function setDefaultEncoding(encoding: string): this

Parámetros

encoding

string

Devoluciones

this

setEncoding(string)

function setEncoding(encoding: string): this

Parámetros

encoding

string

Devoluciones

this

setKeepAlive(boolean, number)

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

Parámetros

enable

boolean

initialDelay

number

Devoluciones

this

setMaxListeners(number)

function setMaxListeners(n: number): this

Parámetros

n

number

Devoluciones

this

setNoDelay(boolean)

function setNoDelay(noDelay?: boolean): this

Parámetros

noDelay

boolean

Devoluciones

this

setTimeout(number, () => void)

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

Parámetros

timeout

number

callback

() => void

Devoluciones

this

uncork()

function uncork()

unpipe(any)

function unpipe(destination?: any): this

Parámetros

destination

any

Devoluciones

this

unref()

function unref(): any

Devoluciones

any

unshift(any)

function unshift(chunk: any)

Parámetros

chunk

any

wrap(any)

function wrap(oldStream: any): this

Parámetros

oldStream

any

Devoluciones

this

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

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

Parámetros

chunk

any

cb

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

Devoluciones

boolean

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

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

Parámetros

chunk

any

encoding

string

cb

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

Devoluciones

boolean

write(any, string, Function)

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

Parámetros

data

any

encoding

string

callback

Function

write(string, Function)

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

Parámetros

str

string

cb

Function

Devoluciones

boolean

write(string, string, Function)

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

Parámetros

str

string

encoding

string

cb

Function

Devoluciones

boolean

write(string, string, string)

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

Parámetros

str

string

encoding

string

fd

string

Devoluciones

boolean

write(ValidBuffer)

function write(buffer: ValidBuffer): boolean

Parámetros

buffer
ValidBuffer

Devoluciones

boolean

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

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

Parámetros

buffer
ValidBuffer
cb

(err?: Error) => void

Devoluciones

boolean