Skip to content
This repository was archived by the owner on Jun 1, 2026. It is now read-only.
This repository was archived by the owner on Jun 1, 2026. It is now read-only.

EOF error #1775

Description

@DerXanRam

Hello guys. I'm using restcpp for subscribing and listening "pending transactions". But some times throws EOF error and my program brokes at runtime. My code sinnipet i use to subscribe web socket is

void socks()
{
    websocket_client client;
    client.connect("wss://bsc-mainnet.blastapi.io/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx").wait();
    string a = R"({"jsonrpc":"2.0","method":"eth_subscribe","params":["newPendingTransactions"],"id":1})";
    websocket_outgoing_message out_msg, unsub_w;

    out_msg.set_utf8_message(a);
    client.send(out_msg).wait();


    while (true)
    {
        client.receive().then([](websocket_incoming_message in_msg)
                              { return in_msg.extract_string(); })
            .then(
                [](string body)
                {
                    ret_str = body;
                    cout << j << " " << ret_str;
                })
            .wait();
        j++;
    }
    client.close().wait();
}

my question is how to avoid this error or how to catch it and handle it to prevent my program from sudden failure? please help 🙏

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions