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

Failure("hd") and Failure("cannot write to closed writer") when websocket connections closes #214

Open
copy opened this issue Dec 14, 2024 · 0 comments

Comments

@copy
Copy link

copy commented Dec 14, 2024

To reproduce:

% dune exec examples/eio/echo_server_upgrade.exe
// run with `node file.js`
const ws = new WebSocket("ws://localhost:8080/");
ws.onopen = function()
{
    console.log("open");
    setTimeout(() => {
        console.log("close");
        ws.close();
    }, 1000);
};

The server outputs (with an ugly backtrace with Printexc.record_backtrace true):

echo_server_upgrade.exe: [INFO] Server listening on tcp:127.0.0.1:12345
echo_server_upgrade.exe: [ERROR] Error in connection handler: Multiple exceptions:
- Failure("hd")
- Failure("cannot write to closed writer")

It would be nice to handle a regular connection closing more gracefully.

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

No branches or pull requests

1 participant