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

Function doWrite

packages/engine.io-client/lib/transports/polling-xhr.ts:59–68  ·  packages/engine.io-client/lib/transports/polling-xhr.ts::doWrite

* Sends data. * * @param {String} data - data to send. * @param {Function} fn - called upon flush. * @private

(data: string, fn: () => void)

Source from the content-addressed store, hash-verified

57 * @private
58 */
59 override doWrite(data: string, fn: () => void) {
60 const req = this.request({
61 method: class="st">"POST",
62 data: data,
63 });
64 req.on(class="st">"success", fn);
65 req.on(class="st">"error", (xhrStatus, context) => {
66 this.onError(class="st">"xhr post error", xhrStatus, context);
67 });
68 }
69
70 /**
71 * Starts a poll cycle.

Callers

nothing calls this directly

Calls 3

requestMethod · 0.45
onMethod · 0.45
onErrorMethod · 0.45

Tested by

no test coverage detected