Download

Packaged game using TCP/IP and UDP sockets does not work.

Hi dear dynamic Unreal community,

I have developed my own TCP and UDP socvkets (with C++) in a UE plugin and I use them inside Blueprint to communicate with an external robot.

The TCP server runs in my Unreal blueprint and a client connects to it from outside.

When I run it within the Editor, everything runs well. I get the data properly.

When I package the game, it becomes impossible to establish the TCP connection from the client to the packaged game.

I am using UE 4.18.

It seems like those protocols are being blocked by Unreal.

I tried disabling TCP and UDP messaging servbices, but then I get a “Fatal error” when starting the packaged game.

Also, I have disabled all antivirus and firewall options to make sure it is not a security issue.

I have tried TCP ports 1024 and 8888.

Is there anything I should do or disable inside Unreal before to package my game ?

Any advice would be greatly appreciated !

Thanks and regards,

     Zoro321

>I tried disabling TCP and UDP messaging servbices, but then I get a “Fatal error” when starting the packaged game.

Its impossible to package game if those plugins disabled. Im interesting why they so important.

Good point. I believe they are involved into network gaming, but if your game is single user, they should not be necessary.

You can use debugger and attach to the packaged game.

Does it work when you play as StandAlone Game?

What are the exact error messages from both TCP client and server (if client attempts to connect to the socket at all) sockets? They might provide some hints to understand at which point the connection fails - at listen, at accept or at send/receive.

Thank you for your answers.

I’ve recompiled it in Debug-Game mode and I have been able to nattach to process under Visual Studio 2017.

I have followed the following links:

Now. I have the same issue than the guy in previous link: How to I place a breakpoint in a standalone game with the process attached to Visual Studio ? From those posts I do not really understand how to do. I can click “Break all”, but it does not even give me access to the code in order to polace a breakpoint.

Hi !

Ok, so I found the cause of my problem: my plugin was of type “Developer” instead of “Runtime”, which means it is loaded into Editor but not in the packaged game.

Also, my code was compiled as “Development Editor”. When I package my game as “Shipping”, then I get a whole bunch of compilation errors.

Now it seems I have to compile my plugin into shipping and go trough all the upcoming compilation errors.