Vibe.d WebSockets crashing the thread

a email at example.edu
Fri Mar 22 20:23:05 UTC 2019


I am working on a project (multiplayer browser-based game) that 
uses websockets. I structured the project so that there are 2 
threads: one of them is the vibe.d web server, and the other is 
the actual server for the game itself.

Because of this structure, I am passing WebSockets from the 
webserver to the game server using std.concurrency.send. This 
seems to barely work though, and it is really unreliable (crashes 
after a few seconds). Sometimes it gives and error about 
core.exception.AssertError at ../../.dub/packages/vibe-core-1.6.1/vibe-core/source/vibe/core/net.d(593): Assertion failure, but other times it just simply stops receiving messages from the websocket (I think this is because the game-server thread may be crashing, but I'm not sure).

Here is some minimal code that reproduces the issue:
source/app.d:
http://dpaste.com/2QCSXC1

and public/index.html:
http://dpaste.com/02QANJY

I would really appreciate if anyone could help me fix this.
Thanks!



More information about the Digitalmars-d mailing list