Skip to content

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

@copy

Description

@copy

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions