Author Topic: NAT punchthrough failed on two android phone  (Read 24476 times)

watchmon

  • Not-a-newbie
  • *
  • Posts: 26
  • Karma: 0
  • see who online
    • View Profile
NAT punchthrough failed on two android phone
« on: November 21, 2012, 05:40:24 AM »
Hi guys!
I have used RakNet 4.051 on iphone4S and android,it works fine as c2s wifi network,when I usr p2p ,these is something worng.
Two iphone works fine ,I can punchthrough the NAT and rakVoice works fine.
One iphone and one android also works,I can punchthrough the NAT and rakVoice alse works fine except echoes.
But when I test two android ,I can`t punchthrough the NAT,the result is 65 ID_NAT_PUNCHTHROUGH_FAIL.
Forword condition,one android phone Samsung GALAXY Note II N7100, the other is Samsung I9100 GALAXY SII,the two android
could punchthrough with iphone4S,but they can`t punchthrough each other,this make confused,how to solve it?

watchmon

  • Not-a-newbie
  • *
  • Posts: 26
  • Karma: 0
  • see who online
    • View Profile
Re: NAT punchthrough failed on two android phone
« Reply #1 on: November 23, 2012, 12:43:57 AM »
Nobody reply :o
I have tried many android phones,they can punchthrough with iphone and PC,but can`t punchthrough with each other.
And I have tested with two Simulator on windows,they have the same solution.
 :-[
I don`t know this is limited by RakNet or android.
Who can help me?

Rak'kar

  • Administrator
  • Hero Member
  • *****
  • Posts: 6895
  • Karma: 291
    • View Profile
    • RakNet
Re: NAT punchthrough failed on two android phone
« Reply #2 on: November 23, 2012, 02:12:08 PM »
On the client, attach NatPunchthroughDebugInterface_PacketLogger. On the server, attach NatPunchthroughServerDebugInterface. Give me the output from both clients, and the server.

watchmon

  • Not-a-newbie
  • *
  • Posts: 26
  • Karma: 0
  • see who online
    • View Profile
Re: NAT punchthrough failed on two android phone
« Reply #3 on: November 25, 2012, 11:05:57 PM »
Sorry for late reply.Weekend and rest,u understand。
If I want print log on android,I should use function below,
__android_log_print(ANDROID_LOG_INFO, "JNIMsg", "Failed: ID_NAT_CONNECTION_TO_TARGET_LOST\n");
But in raknet internal,I guess use printf to print log.
I don`t know if I can use printf on android,I`ll try to fix it.
And on server, I guess u mean to use NatPunchthroughServerDebugInterface_PacketLogger,
not NatPunchthroughServerDebugInterface.
I have tried NatPunchthroughServerDebugInterface_PacketLogger, there isn`t any log showed on console.
But I use NatPunchthroughServerDebugInterface_Printf, there log shows.
May use NatPunchthroughServerDebugInterface_Printf instead of NatPunchthroughServerDebugInterface_PacketLogger ?

Rak'kar

  • Administrator
  • Hero Member
  • *****
  • Posts: 6895
  • Karma: 291
    • View Profile
    • RakNet
Re: NAT punchthrough failed on two android phone
« Reply #4 on: November 29, 2012, 12:16:32 AM »
Yes, I just want the output I don't care about the method.

watchmon

  • Not-a-newbie
  • *
  • Posts: 26
  • Karma: 0
  • see who online
    • View Profile
Re: NAT punchthrough failed on two android phone
« Reply #5 on: December 03, 2012, 10:35:55 PM »
Sorry for late reply.
I have tried to print the logs on android, but my method did not work,
considered about time, I can not foucs on this problem recently.
Because I have to use UDP proxy plugin and rakVoice plugin, I have one
question,does UDP proxy support rakVoice forwarding?
If this`s supported,I can go on to finish business logic,even through android
NAT punchthrough failed.After finish business logic programing I have enough
time to foucs on android NAT punchthrough.
« Last Edit: December 04, 2012, 12:08:43 AM by watchmon »

Rak'kar

  • Administrator
  • Hero Member
  • *****
  • Posts: 6895
  • Karma: 291
    • View Profile
    • RakNet
Re: NAT punchthrough failed on two android phone
« Reply #6 on: December 04, 2012, 06:03:40 PM »
Just use UPNP, it is your easiest fix.

watchmon

  • Not-a-newbie
  • *
  • Posts: 26
  • Karma: 0
  • see who online
    • View Profile
Re: NAT punchthrough failed on two android phone
« Reply #7 on: December 04, 2012, 09:32:19 PM »
Thanks.
I`ll try. ;D

abhiman

  • Not-a-newbie
  • *
  • Posts: 1
  • Karma: 0
    • View Profile
Re: NAT punchthrough failed on two android phone
« Reply #8 on: May 22, 2013, 08:19:50 AM »
Hi, I am trying to build RakVoice on Android and iOS platforms..however, portAudio is giving issue for build on both the platforms. Did you face any issue building with PortAudio? Any pointer on how you could build on both the platforms will be useful.

Rak'kar

  • Administrator
  • Hero Member
  • *****
  • Posts: 6895
  • Karma: 291
    • View Profile
    • RakNet
Re: NAT punchthrough failed on two android phone
« Reply #9 on: May 30, 2013, 01:28:46 PM »
I can't support PortAudio. But it either works or not on that platform. If not, then you'll need to use a sound library that does.

anchor

  • Not-a-newbie
  • *
  • Posts: 3
  • Karma: 0
    • View Profile
Re: NAT punchthrough failed on two android phone
« Reply #10 on: September 03, 2014, 03:09:28 PM »
I had difficulties with NAT punchthrough between mobile devices. I noticed that, the getmyip functions not worked for iOS, and android.
I fixed it for iOS, and the NAT punchthrough began to work between two iOS devices. Now i gonna fix it for android too.
So the getmyip part should be aligned to iOS/android in the raknet head rev.