UnitySocketIO icon indicating copy to clipboard operation
UnitySocketIO copied to clipboard

8 hours straight trying to make the simplest thing work

Open marteleto opened this issue 11 years ago • 2 comments

Hi,

I created a socket io server like this:

var io = require('socket.io').listen(5000);

io.sockets.on('connection', function (socket) { io.sockets.emit('evt', { foo: 'bar'}); });

and a pomelo client like this

using UnityEngine; using System; using System.Collections; using SimpleJson; using pomeloUnityClient;

public class TargetController : MonoBehaviour { private PomeloClient pclient = null;

void Start()
{
    string url = "http://localhost:5000";
    pclient = new PomeloClient(url);
    pclient.init();

    pclient.On("evt", (data)=>{
        Debug.Log("received something");
    });

    JsonObject emptyMessage = new JsonObject();
    emptyMessage.Add ("foo", "bar");

    pclient.notify("connection", emptyMessage);
}

}

and when I run the client part the server side logs this:

debug - client authorized info - handshake authorized BPbGYLLp1TfVeVOaKZAD

And on unity client part I get nothing, zero, no error, warnings, logs, nothing.

Can you help me find out what is missing?

Ty,

marteleto avatar May 09 '14 08:05 marteleto

I'm seeing the same with Node 10.26, Socket.IO 0.9.17, Express 3.20.1 and Unity 4.6.3f1 on Windows 8.1. Running the EXACT same server, Unity app (same Unity version) on OSX, my fellow developer can connect so it seems clear that it's something about the OS implementation.

rainabba avatar Mar 11 '15 23:03 rainabba

Can you please tell me how to create the server in C#

DazzledApps avatar Nov 30 '15 05:11 DazzledApps