I wondering how to communicate between Unity and another application in realtime.
I tried socket.io / websocket. But I don’t found a correct working library (asset).
For example Socket.IO for Unity. This library works until events are emitted.
It connects to my websocket (socket io forced to only use websocket), but after emitting an event from server to client, the client only reconnects. (loop / on every event).
Another Socket.IO Asset (on github for free) has conflicts with the unity engine scripts.
(Errors like … is defined multiple times.)
Conclusion:
There is no correct working socket io / websocket library.
I looking for alternatives. Any idea or hint will help. Thanks for advice.
Btw. socket.io
is more a pseudo websocket library. Because in most of cases it runs on polling / ajax. You can force to use websocket by transports
option to ['websocket']
. But the most examples does not work. In my case a simple websocket server with socket.io does not really works. The server recognized a connection but fails on events. (without errors. the events just don’t work).
At all this is very disappointing. But anyway. The socket.io lib for Unity has an example with socket io forced with websocket. But there I have the loop connection problem on event emit.