Thanks for your insightful reply. I think I will manage to
implement rate limitting for uploading. I've also just found an
article (http://doc.trolltech.com/qq/qq17-ratecontrol.html ) which
implements up/down rate limitting. The interesting part is where
they set a maximum buffer of the socket - if this is reached the
socket will stop receiving data. Is this even possible with BSD
sockets? Or I would have to resort to kernel extensions?
Use the SO_RCVBUF socket option to set the size of the receive buffer
in the kernel. That's what the Trolltech code is doing underneath
the layer they published in that article. Depending on the nature of
your application protocol, you may also need to set the receive low
water mark with SO_RCVLOWAT.
Be aware that these options do not actually force the sender to slow
down-- they only control the size of the window your end advertises
and when your application will be signaled to read more octets. In
practice, though, it means that if the sender is respecting the TCP
window, then you can use these options as a crude hammer with which
to limit its rate over relatively long time intervals.
james woodyatt <email@hidden>
member of technical staff
apple computer, inc.
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