Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emit errors on disconnection #38

Open
ralt opened this issue Nov 11, 2018 · 3 comments
Open

Emit errors on disconnection #38

ralt opened this issue Nov 11, 2018 · 3 comments
Labels

Comments

@ralt
Copy link

ralt commented Nov 11, 2018

Hi,

There's this nice (on :error ...) function, but it's never actually used :-)

Specifically, try to connect a client, then unplug your network cable, and you'll see... nothing. Nothing is happening, forever.

Using (wsd:send-ping) during this time immediately returns NIL, so we can't use it as a heartbeat either.

How can we handle disconnection cases?

@fukamachi
Copy link
Owner

Hm, that's strange and sounds like a bug.

@fukamachi fukamachi added the bug label Aug 9, 2019
@rogersm
Copy link

rogersm commented Apr 6, 2021

I was bitten by the same bug, but after reviewing the code I cannot understand why the (on :error ...) is not being triggered.

@eko234
Copy link

eko234 commented Jun 11, 2021

I think the description of the :error event in the readme says clearly that it is for protocol errors regarding malformed messages, I think maybe the right thing to do is to implement an event to catch other kind of errors, it could use some structure containing functions to respond to certain conditions so the users can define their own way to handle this kind of situations, in the implementation you can see that the handler-case for the error callback states that it is for protocol errors

https://github.com/fukamachi/fast-websocket/blob/24c0217e7c0d25b6ef6ab799452cba0b9fb58f44/src/fast-websocket.lisp#L167

Maybe we could give it a shot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants