Closed nirharpaz closed 2 years ago
hey, are you processing the messages like in this example?
I did in fact it seems that when I started a fresh new script copy-paste it worked. However, I should now alter the issue to the following one: https://stackoverflow.com/questions/72292098/websocket-sending-fails-unless-i-use-invokerepeating
In short, InvokeRepeating works, Invoke doesn't, SendWebSocketMessage() doesn't, coroutine doesn't. can you advise how should I invoke it once in a way It will properly work?
It seems to work now
this is my code
` string WebSocketURI="uri" void Start() { InitilizeWebSocket(); } private async void InitilizeWebSocket() { websocket = new WebSocket(WebSocketURI);
I initialized the server. ReportStartGame generates a JSON which is then sent to the websocket, the communication is received successfully. I tested the output in https://www.piesocket.com/websocket-tester. In response to the Con up, I received a comm from server with a json I should not be handling (with HandleGameData).
However, websocket.OnMessage is never triggered. Its not that there is problem with the data, but the
Debug.Log("new message");
is never invoked.