hapijs / nes

WebSocket adapter plugin for hapi routes
Other
502 stars 87 forks source link

Add client.onHeartbeatTimeout hook #243

Closed mtharrison closed 6 years ago

mtharrison commented 6 years ago

This hook notifies user immediately when a disconnection is initiated due to heartbeat timeout, so they can take action. Previously the only option was to wait for onDisconnection which isn't called until server close frame is received. This leaves a gap between the timeout and disconnection proper when the client is unaware that the connection is not usable.

In future we may make more radical changes to the hooks, such as calling onDisconnect() as soon as the timeout occurs but this is a simple backwards-compatible change that addresses the issue.

Closes #241

cc @dominykas

dominykas commented 6 years ago

Thanks. I suppose this closes https://github.com/hapijs/nes/issues/240 too?

mtharrison commented 6 years ago

Yes, I referenced the PR by mistake. Thanks.

lock[bot] commented 4 years ago

This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions.