Skip to content

Can't connect to NodeJS server if a browser socket.io client has connected first #408

Description

@alec-g

Hello,

Facing an odd issue today, I was able to successfully get my C++ application connecting to my NodeJS Server, however, as soon as I hooked up a browser client (from my frontend application) to the same socket.io server, I started having issues. With the NodeJS server running, if the first client to connect is the socket.io-client-cpp client, the connection is successful. If the first client to connect is the browser socket.io client, the browser connection is successful but the socket.io-client-cpp client will never connect after this, the console output from the C++ client:

[connect] Successful connection
[connect] WebSocket Connection 192.168.8.5:3001 v-2 "WebSocket++/0.8.2" /socket.io/?EIO=3&transport=websocket&t=1696571901 101
[error] handle_read_frame error: websocketpp.transport:7 (End of File)
[disconnect] Disconnect close local:[1006,End of File] remote:[1006]

The browser client always succesfully connects regardless if the cpp client has connected or not. The cpp client will always connect so long as the browser client has not yet connected.

I have tried a few different server / client versions:

  • NodeJS server / client v4.x, C++ client v3.x
  • NodeJS server / client v3.x, C++ client v3.x
  • NodeJS server / client v3.x (with allowEIO3: true), C++ client v2.x

Any advice is appreciated.

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