Greetings, hoping someone can
I’ve got a super dead simple networking example. I started with the free and helpful UNET Basic Dedicated Demo from the Asset Store, and then I simplified it and added a little bit of movement code.
Testing it using a plain windows build, it works fine every time.
- Dedicated server starts with NetwrokManager.StartServer()
- Players connect to the server via NetworkManager StartClient(),
- Players send [Command]s when they move, which get propigated from the server via [ClientRpc] to the other clients. The positions all update and everything works as designed.
So, all good right? Then I do the following:
- Turn on useWebSockets on network manager
- Switch build to WebGL and export my new WebGL client
- Switch back to Windows and export my new server with usewebsockets
- Fire everything up and test again
Is still works, BUT I start seeing scary errors, check this log right after a player connects:
I attached the full log to this with the call stack on these.
The game still works, but these errors keep happening. In fact, I see more with every command, even though the commands are working on all clients (and in the server editor windows even).
It gets worse. If I then stop the server, and restart it to test again, all of Unity will hard crash when a player connects (crash dump says, unhelpfully, “The thread tried to read from or write to a virtual address for which it does not have the appropriate access.”). I can “fix” this by switch platforms a couple times and doing a new build (why? I don’t know), but that just gets my back to the failed to send internal buffer/wrongconnection errors.
Questions (Note: I am using Unity Beta 5.6b7):
- Why is this only happening with useWebSockets?
- Where should I be looking for the source of this problem? I’m not sure where to be looking to trial and error fixes here.
Thanks in advance for any advice!
2951042–218784–log.txt (6.46 KB)