# FIcmp::IcmpEcho do not work Android

**URL:** <https://forums.unrealengine.com/t/ficmp-icmpecho-do-not-work-android/449250>\
**Category:** Mobile\
**Tags:** socket, aws, unreal-engine, Android, question, CPP\
**Created:** [May 20, 2019, 2:33am UTC](https://forums.unrealengine.com/t/ficmp-icmpecho-do-not-work-android/449250 "2019-05-20T02:33:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_6bb0b095](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_6bb0b095](https://forums.unrealengine.com/u/anonymous_user_6bb0b095)\
**Post date:** [May 20, 2019, 2:33am UTC](https://forums.unrealengine.com/t/ficmp-icmpecho-do-not-work-android/449250/1 "2019-05-20T02:33:29Z")

</div>

I want to ping to AWS endpoint, and measure response time.

So I put on this code, editor & windows application is working, but android is not working.

Always android responsed “TimeOut”.

This is my testing mobile information.

“Galaxy note 8(Android 7.1.1)”.

Question:

- How to use “FIcmp::IcmpEcho” for android? and iOS?
- Is there any ping method more simply except “FIcmp::IcmpEcho”?

I put it for other method “FUDPPing::UDPEcho”, but it does’nt work too.

Code:

```
void UAWSManager::GetLatency()
{
    PingReult.BindUObject(this, &UAWSManager::OnPingReply);
    //FUDPPing::UDPEcho(Endpoint, 20.0f, PingReult);
    FIcmp::IcmpEcho(Endpoint, 20.0f, PingReult);
}

void UAWSManager::OnPingReply(FIcmpEchoResult Result)
{
    PingReult.Unbind();
    switch (Result.Status)
    {
    case EIcmpResponseStatus::Success: // windows come here
        break:
    case EIcmpResponseStatus::Timeout: // android come here
        break:
    }
}

```

---

<div class="post-metadata">

**Author:** ![6r0m](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/6r0m/32/1194563_2.png) [@6r0m](https://forums.unrealengine.com/u/6r0m)\
**Post date:** [August 8, 2019, 6:26pm UTC](https://forums.unrealengine.com/t/ficmp-icmpecho-do-not-work-android/449250/2 "2019-08-08T18:26:56Z")

</div>

thanks for your code, it’s help a lot. I’m trying to use it in static functions but without success.

---

<div class="post-metadata">

**Author:** ![lgascoigne](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@lgascoigne](https://forums.unrealengine.com/u/lgascoigne)\
**Post date:** [August 8, 2019, 7:09pm UTC](https://forums.unrealengine.com/t/ficmp-icmpecho-do-not-work-android/449250/3 "2019-08-08T19:09:48Z")

</div>

Have same issue, I get stuff like:

```
08-08 10:53:34.304 916 916 E audit : type=1400 audit(1565286814.289:11481): avc: denied { read } for pid=15300 comm="Thread-5" name="stat" dev="proc" ino=4026532108 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:proc_stat:s0 tclass=file permissive=0 SEPF_SM-G950U1_8.0.0_0011 audit_filtered
08-08 10:53:34.304 916 916 E audit : type=1300 audit(1565286814.289:11481): arch=c00000b7 syscall=56 success=no exit=-13 a0=ffffff9c a1=718de0dd70 a2=0 a3=0 items=0 ppid=936 pid=15300 auid=4294967295 uid=10234 gid=10234 euid=10234 suid=10234 fsuid=10234 egid=10234 sgid=10234 fsgid=10234 tty=(none) ses=4294967295 comm="Thread-5" exe="/system/bin/app_process64" subj=u:r:untrusted_app:s0:c512,c768 key=(null)
```

---

<div class="post-metadata">

**Author:** ![zhaojunmeng](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@zhaojunmeng](https://forums.unrealengine.com/u/zhaojunmeng)\
**Post date:** [August 15, 2023, 12:11pm UTC](https://forums.unrealengine.com/t/ficmp-icmpecho-do-not-work-android/449250/4 "2023-08-15T12:11:32Z")

</div>

On Android, socket(AF\_INET, SOCK\_DGRAM, IPPROTO\_ICMP) in IcmpPosix.cpp, will not receive IP header, so the “PacketHeader = reinterpret\_cast\<struct icmp\*\>(ResultBuffer + IpHeaderSize);” just got the wrong offset.

I’ve made a pull request to fix IcmpEcho on Android, and add support for iOS.  
[https://github.com/EpicGames/UnrealEngine/pull/10789](https://github.com/EpicGames/UnrealEngine/pull/10789)
