Re: iphone to mac .. UDP Woes ..
Re: iphone to mac .. UDP Woes ..
- Subject: Re: iphone to mac .. UDP Woes ..
- From: Andreas Fink <email@hidden>
- Date: Sun, 1 Aug 2010 09:09:59 +0200
On 31.07.2010, at 10:49, J P May wrote:
>> Be aware that the UDP machinery may not start a WiFi connection if one isn't already up (you may need to test to verify that it does).
>
> that is an excellent point, Mark ...
>
>
>> UDP also won't prevent the WiFi antenna from being powered off, TCP will.
>
> True. since the protocol here is continuous (say 30hz) transmission of a few bytes, I slackly assumed I could ignore that problem :-)
>
>
>> In general, I see no reason ever to go with UDP, unless you absolutely must (your protocol requires it)
>
> I wouldn't say the protocol requires it but,
>
> (a) a minor issue -- UDP is perhaps a touch faster for that type of thing.
>
> (b) moreover, the main reason I decided to go that way -- it's just plain easy!
>
> i) two lines of bonjour code on each side to get a hostname..
>
> ii) include the marvellous UDPEcho.h/m example class handily provided by apple earlier this year...
>
> you're done. Solid, simple, easy to understand every line of code...
>
> (Dont forget, i'm going fone-to-mac ... of course for fone-to-fone I just slackly use the gameKit, which is very easy.)
>
> (actually the UDP process I describe above (using the handy "sockets all done for you" UDPEcho class) is perhaps EASIER, really, than using gamekit !)
Just don't forget that UDP packets can get lost and could be processed in reverse order if one packet arrives before the other due to multipath IP routes with different delays. Retransmission is your business in UDP where in TCP it's not.
UDP is perfect for loss tolerant stuff such as video streaming where the loss of a frame is not the end of the world. But it would be a very bad design choice to use it for financial transactions.
The modern SCTP would give you both benefits of TCP and UDP but Apple says we can't have it (yet?).
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden