nx.js
NamespacesSwitchClasses

Server

EventTarget is a DOM interface implemented by objects that can receive events and may have listeners for them.

See

https://developer.mozilla.org/docs/Web/API/EventTarget

Extends

Methods

addEventListener()

addEventListener(type, listener, options)

addEventListener(type, listener, options?): void

The "accept" event is fired when a new TCP client connection has been established. Use the fd property to determine which file descriptor to read / write to interact with this socket.

Parameters
ParameterType
type"accept"
listener(ev) => any
options?boolean | AddEventListenerOptions
Returns

void

Overrides

EventTarget.addEventListener

addEventListener(type, listener, options)

addEventListener(type, listener, options?): void

Parameters
ParameterType
typestring
listenerEventListenerOrEventListenerObject
options?boolean | AddEventListenerOptions
Returns

void

Overrides

EventTarget.addEventListener


close()

close(): void

Shuts down the server and closes any existing client connections.

Returns

void


dispatchEvent()

dispatchEvent(event): boolean

Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise.

Parameters

ParameterType
eventEvent

Returns

boolean

Inherited from

EventTarget.dispatchEvent

See

https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent


removeEventListener()

removeEventListener(type, callback, options?): void

Removes the event listener in target's event listener list with the same type, callback, and options.

Parameters

ParameterType
typestring
callbacknull | EventListenerOrEventListenerObject<any>
options?boolean | EventListenerOptions

Returns

void

Inherited from

EventTarget.removeEventListener

See

https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener

On this page