MCPcopy Create free account
hub / github.com/DeepNotesApp/DeepNotes / constructor

Method constructor

apps/realtime-server/src/sockets.ts:57–79  ·  view source on GitHub ↗
(socket: WebSocket, req: IncomingMessage)

Source from the content-addressed store, hash-verified

55 ][] = [];
56
57 constructor(socket: WebSocket, req: IncomingMessage) {
58 this.socket = socket;
59
60 this.sessionId = req.sessionId;
61
62 socket.on('message', async (message: ArrayBuffer) => {
63 try {
64 await this._setupPromise;
65
66 await this._handleMessage(message);
67 } catch (error) {
68 moduleLogger.error('Message handling error: %o', error);
69 }
70 });
71
72 socket.on('pong', () => {
73 socket.aux.isAwaitingPong = false;
74 });
75
76 socket.on('close', () => {
77 socket.aux?.destroySocket();
78 });
79 }
80
81 private async _checkSessionInvalidated() {
82 if (this.sessionId != null) {

Callers

nothing calls this directly

Calls 2

_handleMessageMethod · 0.95
destroySocketMethod · 0.45

Tested by

no test coverage detected