MCPcopy Create free account
hub / github.com/cameri/nostream / onHeartbeat

Method onHeartbeat

src/adapters/web-socket-adapter.ts:136–146  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

134 }
135
136 public onHeartbeat(): void {
137 if (!this.alive) {
138 logger.error(`web-socket-adapter: pong timeout for client ${this.clientId} (${this.getClientAddress()})`)
139 this.client.close()
140 return
141 }
142
143 this.alive = false
144 this.client.ping()
145 debugHeartbeat('client %s ping', this.clientId)
146 }
147
148 public getSubscriptions(): Map<string, SubscriptionFilter[]> {
149 return new Map(this.subscriptions)

Callers

nothing calls this directly

Calls 2

getClientAddressMethod · 0.95
closeMethod · 0.65

Tested by

no test coverage detected