Skip to content

Error getting remote endpoint #445

Description

@Suresh3d

I am getting these errors when. trying to connect to the server . Can anyone help with this ?

[info] Error getting remote endpoint: asio.system:57 (Socket is not connected) [2025-08-22 13:28:04] [error] handle_connect error: Timer Expired

here is the code ,

    `sio::client h;

    // ---- Connection Open ----
    h.set_open_listener([&]() {
        std::cout << "Connected!" << std::endl;
    });

    // ---- Connection Failed ----
    h.set_fail_listener([&]() {
        std::cout << " Connection failed" << std::endl;
    });

    // ---- Connection Closed ----
    h.set_close_listener([&](sio::client::close_reason const& reason) {
        std::cout << "Disconnected." << std::endl;
    });


std::map<std::string, std::string> headers;
headers["User-Agent"] = "cpp-socketio-client";
headers["user"] =  userId;
headers["token"] = token;

h.connect("http://breezeapi.icicidirect.com/ohlcvstream", {}, headers);

sio::message::list join_args;
join_args.push(sio::string_message::create("4.1!7299"));
h.socket()->emit("join", join_args);

    // ---- Tick Updates ----

h.socket()->on("1SEC", [&](sio::event& ev) {
    auto msg = ev.get_message();
            if (msg) {
                std::cout << "📊 Tick Data: " << msg->get_string() << std::endl;
            } else {
                std::cout << "📊 Tick Event (non-string)" << std::endl;
            }
});


std::this_thread::sleep_for(std::chrono::minutes(5));`

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