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

**URL:** <https://forums.unrealengine.com/t/packaged-game-using-tcp-ip-and-udp-sockets-does-not-work/110560>\
**Category:** C++\
**Tags:** unreal-engine\
**Created:** [May 7, 2018, 6:36pm UTC](https://forums.unrealengine.com/t/packaged-game-using-tcp-ip-and-udp-sockets-does-not-work/110560 "2018-05-07T18:36:48Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zoro123](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Zoro123](https://forums.unrealengine.com/u/Zoro123)\
**Post date:** [May 7, 2018, 6:36pm UTC](https://forums.unrealengine.com/t/packaged-game-using-tcp-ip-and-udp-sockets-does-not-work/110560/1 "2018-05-07T18:36:48Z")

</div>

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
```

---

<div class="post-metadata">

**Author:** ![redbox](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@redbox](https://forums.unrealengine.com/u/redbox)\
**Post date:** [May 8, 2018, 6:34pm UTC](https://forums.unrealengine.com/t/packaged-game-using-tcp-ip-and-udp-sockets-does-not-work/110560/2 "2018-05-08T18:34:04Z")

</div>

＞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.

---

<div class="post-metadata">

**Author:** ![Zoro123](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Zoro123](https://forums.unrealengine.com/u/Zoro123)\
**Post date:** [May 8, 2018, 8:29pm UTC](https://forums.unrealengine.com/t/packaged-game-using-tcp-ip-and-udp-sockets-does-not-work/110560/3 "2018-05-08T20:29:54Z")

</div>

> [@redbox](#):
>
> ＞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.

---

<div class="post-metadata">

**Author:** ![OptimisticMonkey](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/optimisticmonkey/32/906571_2.png) [@OptimisticMonkey](https://forums.unrealengine.com/u/OptimisticMonkey)\
**Post date:** [May 8, 2018, 8:40pm UTC](https://forums.unrealengine.com/t/packaged-game-using-tcp-ip-and-udp-sockets-does-not-work/110560/4 "2018-05-08T20:40:03Z")

</div>

You can use debugger and attach to the packaged game.

Does it work when you play as StandAlone Game?

---

<div class="post-metadata">

**Author:** ![midix](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@midix](https://forums.unrealengine.com/u/midix)\
**Post date:** [May 9, 2018, 8:40pm UTC](https://forums.unrealengine.com/t/packaged-game-using-tcp-ip-and-udp-sockets-does-not-work/110560/5 "2018-05-09T20:40:54Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Zoro123](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Zoro123](https://forums.unrealengine.com/u/Zoro123)\
**Post date:** [May 10, 2018, 4:50pm UTC](https://forums.unrealengine.com/t/packaged-game-using-tcp-ip-and-udp-sockets-does-not-work/110560/6 "2018-05-10T16:50:33Z")

</div>

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:

> **[A new, community-hosted Unreal Engine Wiki](https://forums.unrealengine.com/t/a-new-community-hosted-unreal-engine-wiki/141494)**
>
> After over a year in maintenance mode, the official Unreal Engine Wiki is now permanently offline. These resources now live on a new community-run Unreal Engine Community Wiki — ue4community.wiki! You will be able to find content from the official...

[https://forums.unrealengine.com/development-discussion/c-gameplay-programming/1365212-how-to-debug-my-game-in-visual-studio-solved](https://forums.unrealengine.com/development-discussion/c-gameplay-programming/1365212-how-to-debug-my-game-in-visual-studio-solved)

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.

---

<div class="post-metadata">

**Author:** ![Zoro123](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Zoro123](https://forums.unrealengine.com/u/Zoro123)\
**Post date:** [May 13, 2018, 4:37pm UTC](https://forums.unrealengine.com/t/packaged-game-using-tcp-ip-and-udp-sockets-does-not-work/110560/7 "2018-05-13T16:37:29Z")

</div>

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.
