Android Peer-to-Peer Connection
Asked Answered
A

2

0

I need to make a peer-to-peer connection between two android phones running i-jetty web server through gprs channel.But many mobile operators block the inbound connections to the phones.Is there any way around it?

Anaphora answered 1/7, 2012 at 11:39 Comment(0)
Z
1

NAT penetration is complex enough that you really shouldn't mess with it until you're quite familiar with the internals of networking. The autonomous NAT traversal used by pwnat is pretty much the state of the art these days.

The basic idea is to use the fact that a router might have any IP address and as far as a NAT knows, any source IP address is valid for an ICMP error message, which the NAT will forward to its client.

Note that you can usually only get UDP through. So you'll have to implement your own byte-stream protocol.

Zincography answered 1/7, 2012 at 11:54 Comment(0)
M
1

In general, the most reliable way of getting two phones talking to each other is using C2DM (or GCM, now). Perhaps you can have the devices exchange their IP addresses using C2DM (which may get you nothing at all, btw, if its an address behind a router or firewall with blocked ports). You could also use SMS depending on the needs of your apps.

Usually there'd be a server of yours involved--additional development--but for short messages, I don't see why one device cannot directly post via C2DM to another device. (This is an untested statement, beware.)

Missis answered 1/7, 2012 at 22:10 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.