disconnect (realtime-gateway)

CopilotKit · realtime, socket-disconnect, connection-management, reconnection-prevention

Intentionally closes the socket connection, marking it as intentional and clearing any error or retry timers to prevent reconnection attempts.

// Source: https://github.com/CopilotKit/CopilotKit.git | License: MIT | Copyright Atai Barkai
// Provided via justclaw.it.com; keep this notice with the code.
    disconnect: () => {
      closingIntentionally = true;
      clearErrorWithoutCloseTimer();
      clearGiveUpTimer();
      socket.disconnect();
    },

See the full source, get the GitHub permalink, and search 40K more like it.

Get a free API key