UDP transfer latency

44 views
Skip to first unread message

Petra

unread,
Mar 5, 2012, 5:04:53 PM3/5/12
to CocoaAsyncSocket
Hi, I need to transfer captured images (20 FPS, about 50kB each) over
WiFi to iPad 2 with minimal latency. I have implemented TCP version
with GDCAsyncSocket which works fine in certain conditions. I tried to
implement some kind of flow control on server side (Win PC) but it did
not help in some network configurations. I was advised to use UDP for
these purposes. I used GDCAsyncUdpSocket but received images have
constant 11-13 seconds (first growing, than adjust on this value)
latency, not much depending on datagram size, frame rate or size of
the image. Is it possible to transfer such amount of data flawlessly
via UDP? Should I look deeper into my current implementation? Are
there any limits while using GDCAsyncUdpSocket? Thanks guys for any
reply.

Tereus Scott

unread,
Mar 5, 2012, 10:04:55 PM3/5/12
to cocoaasy...@googlegroups.com
Petra
You are overflowing the UDP buffers. Don't forget that this is
asynchronous UDP. This means that it is trying to deliver every
packet you send. What you want to do is to deliver the frames as fast
as they can go out on the network. I suggest that you check the UDP
queue size each time you want to send a frame. If it is greater than 2
(or 3) then drop the frame.
This should give you the optimal throughput.

Tereus Scott
Little Tiny Machines

> --
> You received this message because you are subscribed to the Google Groups "CocoaAsyncSocket" group.
> To post to this group, send email to cocoaasy...@googlegroups.com.
> To unsubscribe from this group, send email to cocoaasyncsock...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/cocoaasyncsocket?hl=en.
>

Reply all
Reply to author
Forward
0 new messages