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

Method doPoll

packages/engine.io-client/lib/transports/polling-fetch.ts:13–25  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

11 */
12export class Fetch extends Polling {
13 override doPoll() {
14 this._fetch()
15 .then((res) => {
16 if (!res.ok) {
17 return this.onError("fetch read error", res.status, res);
18 }
19
20 res.text().then((data) => this.onData(data));
21 })
22 .catch((err) => {
23 this.onError("fetch read error", err);
24 });
25 }
26
27 override doWrite(data: string, callback: () => void) {
28 this._fetch(data)

Callers 1

_pollFunction · 0.45

Calls 3

_fetchMethod · 0.95
onErrorMethod · 0.45
onDataMethod · 0.45

Tested by

no test coverage detected