UnitySocketIO icon indicating copy to clipboard operation
UnitySocketIO copied to clipboard

Cant emit SocketIO Events

Open awdng opened this issue 12 years ago • 3 comments

I cant seem to emit Events on my SocketIO node-js server. The Emit function doesnt seem to do anything.

I have seen some examples from pomelo clients but they use a custom protocol which SocketIO Servers dont recognize...So why is this called a SocketIO library ? Its a Websocket library using a custom protocol imo.

I can recieve Events in Unity with my own custom EventHandler, but i cant send Messages to the server.

Any help appreciated, the pomelo examples dont help me though, its a custom binary protocol.

awdng avatar Oct 19 '13 13:10 awdng

The emit and recieving of events are not properly functioning because of the json parser parsing "name" as "Name" and "args" as "Args" which are the main keywords for forming an event message. I dont have a proper solution because i have used another solution for my ios project. You can get some from below link

https://github.com/NetEase/UnitySocketIO/issues/9

vrwalking avatar Oct 29 '13 09:10 vrwalking

@awdng could you share your custom EventHandler to recieve Events in Unity?

static-x avatar Oct 29 '13 14:10 static-x

I actually decoded the JSON myself and just emitted an event based on the string in the JSON message. I deleted it though as i removed this lib from my project because i cant emit events on to the socketIO server. If what @vrwalking says is true, one could maybe make it emit events when constructing the correct json with lowercase strings, or someone could fork this, make the changes so that Event stuff works correctly and make a pull request. I dont really have time for that currently though.

awdng avatar Oct 30 '13 11:10 awdng