FTcpListener crash. Expects to be running in "game" thread, but spawns its own.ad - crashes.p
If I create a FTcpListener in the main thread, I get an error message saying:
This is the callstack:
asked Jun 28 '14 at 12:31 AM in Bug Reports
I'm afraid you have discovered some code rot. The FTcpListener class will in fact no longer work as is. The problem is that, as your callstack indicates the socket creation is dependent on loading the Sockets module on demand. Module loading is not thread-safe, so we added an assertion a few months ago, which is what you're seeing.
The FTcpListener class needs to be redesigned, properly taking into account the module loading limitations. In the meantime you can use the following workaround:
This will prevent the socket creation code in Init() from being executed. The thread's Run() function also depends on the Sockets module for creating FInternetAddr instances, but that should be OK as the platform's socket subsystem module should already be loaded at that point, so that no module load is necessary.
Development on the Networking module was suspended last year, and it needs a major overhaul. I'm hoping to get back to it later this Summer or early Fall. Until then it should be considered experimental.
Let me know if you run into any other issues!
answered Jun 30 '14 at 02:28 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here