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

Connection hanging, not connecting #352

Open
givowo opened this issue Jan 21, 2024 · 1 comment
Open

Connection hanging, not connecting #352

givowo opened this issue Jan 21, 2024 · 1 comment

Comments

@givowo
Copy link

givowo commented Jan 21, 2024

I'm trying to use this library with unity, .Net Framework 4.7.2
My client code is

SocketIOClient.SocketIO client = new SocketIOClient.SocketIO("http://localhost:3000/");
client.OnConnected += async (sender, e) =>
{
   Debug.Log("connected");
};
await client.ConnectAsync();

and my server is

const httpServer = require("http").createServer();
const io = require("socket.io")(httpServer);

io.on("connection", (socket) => {
    console.log("connection");
});

io.listen(3000);

and the OnConnected callback is never called.

Turning on socket.io debug, I get these messages

 socket.io:server incoming connection with id c9nbGGFTm8ZkzJmkAAAC +4m
  socket.io:server incoming connection with id NqzWWA4ai2SYM4JzAAAD +72ms
  socket.io:client client close with reason transport close +3m
  socket.io:client no namespace joined yet, close the client +29s
  socket.io:client forcing transport close +0ms
  socket.io:client client close with reason forced server close +0ms

its trying to connect, but doesnt (for whatever reason)

help would be greatly appreciated :)

@doghappy
Copy link
Owner

Not sure what is the real reason. it would be better if you have a reproduce repo. what's the version of socket.io in your server?

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

2 participants