MCPcopy
hub / github.com/socketio/socket.io / doClose

Function doClose

packages/engine.io-client/lib/transports/polling.ts:122–137  ·  view source on GitHub ↗

* For polling, send a close packet. * * @protected

()

Source from the content-addressed store, hash-verified

120 * @protected
121 */
122 override doClose() {
123 const close = () => {
124 debug("writing close packet");
125 this.write([{ type: "close" }]);
126 };
127
128 if ("open" === this.readyState) {
129 debug("transport open - closing");
130 close();
131 } else {
132 // in case we're trying to close while
133 // handshaking is in progress (GH-164)
134 debug("transport not open - deferring close");
135 this.once("open", close);
136 }
137 }
138
139 /**
140 * Writes a packets payload.

Callers

nothing calls this directly

Calls 2

debugFunction · 0.85
closeFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…