TCP Socket Listener, Receiving Binary Data into UE4 From a Python Script!

Hi there!

This sounds like something is getting garbage collected, but I am not sure what! Do you have any UObject* involved in your project that are not UPROPERTY() that might be getting GC’ed ?

Wiki on UE4 Garbage Collection
https://wiki.unrealengine.com/Garbage_Collection_%26_Dynamic_Memory_Allocation#Preventing_Garbage_Collection

Other than Garbage Collection I am not aware of anything else that would have such a consistent time out.

I have several clients that use my TCP code, for hours at a time, without issue so there must be something going on in your project that is causing this strange timeout.

It sounds like your ANetwork class is disappearing for some reason, and it contains the FSocket ptr, can you try running all your code from the player controller entirely?

Move all ANetwork code into player controller as a test?

That would help narrow down the issue, as there’s no way the PC would get GC’ed somehow or disappear :slight_smile:

Elimate the use of an instanced actor ANetwork (and use only PC) and let me know how it goes!

This is just to test the matter, not saying it is a final solution :slight_smile:

Good luck!

:slight_smile: