Re: Capping of sockets
Re: Capping of sockets
- Subject: Re: Capping of sockets
- From: David Aames <email@hidden>
- Date: Sat, 10 Jun 2006 10:12:27 +0100
Hi all again,
I've been playing with SO_RCVBUF to limit the download and it works.
The way I've achieved is really the worst - set SO_RCVBUF to some
value(e.g., 1024*15) and sleep(1) so it transfers at 15 KiB/s. The
bad thing about this approach is that the sleep call blocks the main
loop and pretty much everything else. If I put every socket on a
separate thread it would actually kill the performance of the
application when I have more than 30-40 connections. So I've read
about the TCP window and I *think* what I need to do is control the
acknowledgment of the received data i.e., acknowledge as much as I
want to limit the download speed. So my question is which function is
actually sending the transfer ACK? As Scott Ribe previously stated
that calling read() every now and then has no effect I presume it's
not read() which ACKs the transfer.
Regards
_______________________________________________
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