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
| Parameter | Type | 
|---|---|
| type | "accept" | 
| listener | ( ev) =>any | 
| options? | boolean|AddEventListenerOptions | 
Returns
void
Overrides
addEventListener(type, listener, options)
addEventListener(type, listener, options?): void
Parameters
| Parameter | Type | 
|---|---|
| type | string | 
| listener | EventListenerOrEventListenerObject | 
| 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
| Parameter | Type | 
|---|---|
| event | Event | 
Returns
boolean
Inherited from
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
| Parameter | Type | 
|---|---|
| type | string | 
| callback | null|EventListenerOrEventListenerObject<any> | 
| options? | boolean|EventListenerOptions | 
Returns
void
Inherited from
EventTarget.removeEventListener
See
https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener