# Ipc send problem

**URL:** <https://forums.unrealengine.com/t/ipc-send-problem/336008>\
**Category:** C++\
**Tags:** unreal-engine, UE4, CPP, question\
**Created:** [October 21, 2015, 1:12pm UTC](https://forums.unrealengine.com/t/ipc-send-problem/336008 "2015-10-21T13:12:46Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![MaxPonka](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MaxPonka](https://forums.unrealengine.com/u/MaxPonka)\
**Post date:** [October 21, 2015, 1:12pm UTC](https://forums.unrealengine.com/t/ipc-send-problem/336008/1 "2015-10-21T13:12:46Z")

</div>

Hello. I have some c++ code

```
int sock = nn_socket(AF_SP, NN_PAIR);
    assert(sock>=0);
    assert(nn_connect(sock, URL)>=0);
    int to = 100;
    assert (nn_setsockopt (sock, NN_SOL_SOCKET, NN_RCVTIMEO, &to, sizeof (to)) >= 0);
    UE_LOG(LogClass, Log, TEXT(" ___SET SOCK OPTION___"));
    int sz_n = strlen (msg) + 1; // '\0'
    printf ("%d\n", sz_n);
    int bytes = nn_send (sock, msg, sz_n, 0);
    printf ("%d\n", bytes);
    assert(bytes >= 0 );

```

and I have node.js server.

If I call this code from standart c++ console application - everything is worked true, but if i call from ue4 project - i get delay for nn\_send. What is my problem?  
Best regards

---

<div class="post-metadata">

**Author:** ![Shadowriver](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Shadowriver](https://forums.unrealengine.com/u/Shadowriver)\
**Post date:** [October 21, 2015, 3:23pm UTC](https://forums.unrealengine.com/t/ipc-send-problem/336008/2 "2015-10-21T15:23:58Z")

</div>

Use UE4 socket APIs

> **[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 — https://unrealcommunity.wiki/! You will be able to find content from...

Generly avoid using standard C++ or external libraries if UE4 APIs has what you want, it helps your code to work properly with UE4

---

<div class="post-metadata">

**Author:** ![MaxPonka](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MaxPonka](https://forums.unrealengine.com/u/MaxPonka)\
**Post date:** [October 21, 2015, 8:35pm UTC](https://forums.unrealengine.com/t/ipc-send-problem/336008/3 "2015-10-21T20:35:38Z")

</div>

ty very much for reply, but my architecture use ipc for communication launcher and game, and I use nanomsg libs for this. Can I use ue4 sockets for ipc?  
Best regards.

---

<div class="post-metadata">

**Author:** ![MaxPonka](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MaxPonka](https://forums.unrealengine.com/u/MaxPonka)\
**Post date:** [October 22, 2015, 10:39am UTC](https://forums.unrealengine.com/t/ipc-send-problem/336008/4 "2015-10-22T10:39:00Z")

</div>

If I would use UE4 TCP to connect between Unreal game client and my application running in the same host.  
Does Unreal has blocking any TCP ports or not? @anonymous\_user\_f5a50610

---

<div class="post-metadata">

**Author:** ![Shadowriver](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Shadowriver](https://forums.unrealengine.com/u/Shadowriver)\
**Post date:** [October 22, 2015, 2:27pm UTC](https://forums.unrealengine.com/t/ipc-send-problem/336008/5 "2015-10-22T14:27:13Z")

</div>

Oh ok, hmmm then delay might be caused by something nanomsg or maybe size of UE4 is related to that? Because that only diffrence i can think of, UE4 does nothing to nanomsg and your module runs the same code, you used VS in both right? Maybe change “assert” to “check” as this is what i see in engine

---

<div class="post-metadata">

**Author:** ![Shadowriver](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Shadowriver](https://forums.unrealengine.com/u/Shadowriver)\
**Post date:** [October 22, 2015, 2:28pm UTC](https://forums.unrealengine.com/t/ipc-send-problem/336008/6 "2015-10-22T14:28:05Z")

</div>

I don’t think so, sockets are sockets and they can do what system allows
