Skip to main content
Server.prototype.emit - http - Node documentation
method Server.prototype.emit

Usage in Deno

import { Server } from "node:http";
Server.prototype.emit(
event: string,
...args: any[],
): boolean

Parameters

event: string
...args: any[]

Return Type

boolean
Server.prototype.emit(event: "close"): boolean

Parameters

event: "close"

Return Type

boolean
Server.prototype.emit(
event: "connection",
socket: Socket,
): boolean

Parameters

event: "connection"
socket: Socket

Return Type

boolean
Server.prototype.emit(
event: "error",
err: Error,
): boolean

Parameters

event: "error"
err: Error

Return Type

boolean
Server.prototype.emit(event: "listening"): boolean

Parameters

event: "listening"

Return Type

boolean
Server.prototype.emit(
event: "checkContinue",
req: InstanceType<Request>,
res: InstanceType<Response> & { req: InstanceType<Request>; },
): boolean

Parameters

event: "checkContinue"
req: InstanceType<Request>
res: InstanceType<Response> & { req: InstanceType<Request>; }

Return Type

boolean
Server.prototype.emit(
event: "checkExpectation",
req: InstanceType<Request>,
res: InstanceType<Response> & { req: InstanceType<Request>; },
): boolean

Parameters

event: "checkExpectation"
req: InstanceType<Request>
res: InstanceType<Response> & { req: InstanceType<Request>; }

Return Type

boolean
Server.prototype.emit(
event: "clientError",
err: Error,
socket: stream.Duplex,
): boolean

Parameters

event: "clientError"
err: Error
socket: stream.Duplex

Return Type

boolean
Server.prototype.emit(
event: "connect",
req: InstanceType<Request>,
socket: stream.Duplex,
head: Buffer,
): boolean

Parameters

event: "connect"
req: InstanceType<Request>
socket: stream.Duplex
head: Buffer

Return Type

boolean
Server.prototype.emit(
event: "dropRequest",
req: InstanceType<Request>,
socket: stream.Duplex,
): boolean

Parameters

event: "dropRequest"
req: InstanceType<Request>
socket: stream.Duplex

Return Type

boolean
Server.prototype.emit(
event: "request",
req: InstanceType<Request>,
res: InstanceType<Response> & { req: InstanceType<Request>; },
): boolean

Parameters

event: "request"
req: InstanceType<Request>
res: InstanceType<Response> & { req: InstanceType<Request>; }

Return Type

boolean
Server.prototype.emit(
event: "upgrade",
req: InstanceType<Request>,
socket: stream.Duplex,
head: Buffer,
): boolean

Parameters

event: "upgrade"
req: InstanceType<Request>
socket: stream.Duplex
head: Buffer

Return Type

boolean