Search Unity

Javascript Runtime.DynCall in .jslib file Unreliable?

Discussion in 'Editor & General Support' started by killer1171090, Jan 17, 2022.

  1. killer1171090

    killer1171090

    Joined:
    Feb 23, 2013
    Posts:
    145
    Hey, started using SimpleWebTransport for a game I'm working on, its a WebSocket Client and Server that supports WebGL. On the WebGL client, it uses a jslib and Runtime.dynCall to send Messages from Javascript to Unity. Everything appears to be set up correctly and works fine, for a bit. I have no idea why, but it seems after a little while Runtime.dynCall just ceases to function. It works with an infinite ping/pong but the moment I start sending real game data it just fails. I have confirmed the Javascript is getting the messages and can log its information, it's just not getting to c#.
    So Runtime.dynCall isn't getting the message to unity, What's weird is that it works at the start, after some different data is sent it just Stops, Where it stops varies, sometimes it stops quickly other times it lasts a little while. But an Infinite ping pong with 200kb of data each time lasts as far as I can tell, forever.
    Once it stops it never sends another call to unity, I know Runtime.dynCall IS being run, it's just not actually doing anything anymore.

    Heres SimpleWebTransport if you wanna take a look at the code:
    https://github.com/James-Frowen/SimpleWebTransport

    I'm using Unity 2019.4.0f1, I'm also not using Mirror (What SimpleWebTransport was made for), and the server isn't in Unity, it's a Standalone .net 5 Server. The Client however is Unity and is targetting WebGL.

    Any help figuring out what's happening would be greatly appreciated!