Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: Capping of sockets
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Capping of sockets



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


References: 
 >Re: Capping of sockets (From: Scott Ribe <email@hidden>)
 >Re: Capping of sockets (From: David Aames <email@hidden>)
 >Re: Capping of sockets (From: james woodyatt <email@hidden>)
 >Re: Capping of sockets (From: "David Aames" <email@hidden>)
 >Re: Capping of sockets (From: james woodyatt <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.