• Advertisement
Sign in to follow this  

Peer to Peer Android

This topic is 2114 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Everywhere I look people say "true peer to peer is not possible". I swear I had it working a few weeks back. Unfortunately I was not using source control for this project but in an early test I swear I 100% saw the other player moving blocks in a puzzle game. My setup is standard:

Player1,Player2 use port 35000.

Player1, Player2 -> Send to server I'm online. Server looks at the packet and grabs the IP/port. Sends a reply back. (Complete) The ports have translated from 35000 to some other number say 47000.

Player1, Player2 -> Send to server I want to join game. Looks at current players list and sends each others IP addresses out to each other.

Both players hold each others IP's and NAT'd ports. They both try to send out their 35000 ports to each other but neither one receive data. They do still maintain receiving data from the main server though. The only thing I can think of is that the firewall only accepts data from the very first IP it tried to contact. But again, I swear I had this working the other day.

Ideas?

Share this post


Link to post
Share on other sites
Advertisement
Peer to peer is most certainly possible on the devices. The connectivity of various machines is independent of their physical layout on the Internet.

It sounds like you are having an issue with NAT punchthrough. Your server should act as the matchmaker and the introducer.

I'm moving this to the Networking forum since it has nothing to do with handhelds and everything to do with networking. Please read the forum's FAQ, especially those dealing with negotiating your way through NAT.

Share this post


Link to post
Share on other sites
When I used to work for a will-remain-unnamed phone manufacturer, we did actually tinker with P2P networking on handhelds.

The biggest issue, which ended up being relatively unsurmountable, was that the TelCo (your wireless provider) was filtering specific packets; we could never receive connections. Therefore, we could connect to other servers, so long as they weren't handhelds, but handhelds could not act as servers in any fashion. Now, this would be solveable by using a middle-man server (both handsets connect to it, and it just passes through data), but that wasn't practical for us.

This may or may not apply to your situation. My I ask whom your service provider is?

Share this post


Link to post
Share on other sites

The biggest issue, which ended up being relatively unsurmountable, was that the TelCo (your wireless provider) was filtering specific packets; we could never receive connections. Therefore, we could connect to other servers, so long as they weren't handhelds, but handhelds could not act as servers in any fashion.

In many countries that would run afowl of both anti-trust and common carrier laws.

That becomes not an issue that the device is incapable of it; it becomes an issue of an ISP censoring your Internets.

If your Internet is censored then all connectivity bets are off.

Share this post


Link to post
Share on other sites
If your Internet is censored then all connectivity bets are off. [/quote]

In reality, your internets are censored no matter where you live. The degree to which they are censored, and the degree to which you care, and the degree to which it is detectable, may vary by locale. But assuming you can send and receive unlimited amounts of data to and from any endpoint is simply not realistic.


Share this post


Link to post
Share on other sites
I think that you're both confusing filtering with censorship; they are different. Censorship is blocking information. They aren't blocking information, they are blocking specific kinds of connections. They are well within their rights to do that; they make no guarantees that their services can be used to host data, only to receive and send.

In fact, most ISPs in the United States block certain ports by default, and the vast majority of wireless providers block their devices from hosting connections.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement