Websocket Server and Client in same app (using sample project)

I’m using the sample project here: armory_examples/network_zui_chat at master · armory3d/armory_examples · GitHub

I am compiling it to windows C, and debugging it from VS. The websocket server starts, the client connects. I can sometimes send one message and it displays in the chat box. But, it immediately closes the connection. The websocket server is still running, but the client closes.

If I leave that instance running, and startup another instance in HTML5, I can still connect and send messages. The HTML5 instance doesn’t disconnect.

It seems like when running the project in Visual Studio, it refuses to run the client and server in the same process. Has anyone else hit this or knows how to fix it? Do I need to somehow spawn the server in a subprocess or am I missing something obvious here?

Thanks for any tips :smiley:

Maybe someone knows of a guide to debug an Armory3d project in VSCode with a C/C++ target on windows? Then I can debug this and try to get to the root of it.

I saw some hxcpp-debug-server examples but it seems to be for Haxe and mainly hxml files, not for Kha. Is there a way to use Kha with hxcpp-debug-server in vscode?

As an example, I took this sample Haxe project that has all the possible Haxe targets nicely specified but, I don’t know how to start a target with Kha

Seems odd to me that the armory network sample project must be compiled to C/C++ to run but, there is no way to debug it. Is that a common issue with Armory maybe?

I found this but, no documentation. Not sure if its intended just for the community contributors or what. I may investigate this next.

I may update this thread as I get deeper into it in case anyone else is interested in this topic

Found another sample project of networking for Haxe. It doesn’t start out of the box but, with some work you can get it running different types of socket servers. One which uses NodeJS instead of armory’s js.html.websocket library. Which means I can try to replicate my issue (if it is a windows networking problem) with a javascript target which may have better debug options

I tried to use the example for Websocket without success.
Please know how I can create a customer and send a message tell me how.