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

What version of socket.io do I need? #18

Open
jeffijoe opened this issue Nov 26, 2013 · 3 comments
Open

What version of socket.io do I need? #18

jeffijoe opened this issue Nov 26, 2013 · 3 comments

Comments

@jeffijoe
Copy link

I am struggling to get this working, I only received "handshake authorized" in my server, and socket opened event does not fire.

Server:

io.sockets.on('connection', function(socket) {
    console.log("-- Socket connected!");
    socket.emit("message", "Welcome fagget!");
});

Unity client:

        client = new Client("http://localhost:1337");
        client.Opened += SocketOpened;
        client.Message += SocketMessage;
        client.SocketConnectionClosed += SocketConnectionClosed;
        client.Error += SocketError;

        Debug.Log("Client set up, connecting..");

        client.On("message", data =>
        {
            Debug.Log("Message received!");                         
        });

        client.Connect();
@rainabba
Copy link

I can confirm that after calling .Connect() on the client, a handshake does occur, but the client shows as connecting still and never seems to progress.

@jeffijoe
Copy link
Author

@rainabba we ended up using raw TCP sockets instead.

@rainabba
Copy link

My issue was insanely silly. When my server bound to "localhost" (Both my Hapi and Express versions), it was apparently binding to an interface that wasn't connected to the same "localhost" as my Unity app. Even when I updated my unity app to connect to my local ip, it still refused to work. When I bound my Socket.IO server to my IP, it suddenly worked which led to me to find that i had vmware virtual interfaces (for Workstation) that were interfering and when I disabled them OR bound my server to a particular IP, the client would then connect so for me this turned out to be a Windows/Networking/Node issue which I've not seen before even though my regular workstation also has vmware workstation on it.

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