Re: Finding an available port for chat
Re: Finding an available port for chat
- Subject: Re: Finding an available port for chat
- From: glenn andreas <email@hidden>
- Date: Fri, 17 Jul 2009 21:20:50 -0500
On Jul 17, 2009, at 9:08 PM, Development wrote:
I'm not trying to skirt around rules. Yahoo chat works on my
machine, So did msn years back when I had it and so does teamspeak
and ventrilo so I know there are ports out there that are free to be
used I'm just not sure how to go about choosing one or if I should
just hard code it. It's not a file exchange program just text chat
and the two iPhones will communicate directly with each other rather
than through my server since frankly I have high bandwidth demands
as is. That and I cannot run a chat server daemon on the server
since it's shared hosting rather than dedicated.
(As a nearly identical question asked less that a week ago -
seriously, do some searching to turn up a wealth of suggestions and
comments...):
In general, this will only work if the two phones are on the same
local network (such as on the wifi). If that's the case, you can
just use Bonjour for discovery and it will handle assigning port number.
Otherwise, for example, if the two devices are using 3G to connect to
the internet, even if they are set up to accept connections, the cell
network NAT will disallow incoming connections. More complicated
approaches (google "tcp hole punching" or "NAT Traversal") are needed
for that (and I'm not sure that those techniques will work across cell
networks).
You can, however, have both devices connect to the same remote server,
and have it forward packets between them, but that approach does not
scale well.
You're really going to have to do some more research on networking and
peer-to-peer connections to understand the ramifications of trying to
have one random device talk to another random device.
Glenn Andreas email@hidden
<http://www.gandreas.com/> wicked fun!
Mad, Bad, and Dangerous to Know
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden