- From: Robert O'Callahan <robert@ocallahan.org>
- Date: Thu, 26 Nov 2009 12:04:28 +1300
- To: Sebastian Andersson <bofh69@gmail.com>
- Cc: public-webapps@w3.org
- Message-ID: <11e306600911251504x49330f0era6ba9e35cdf78986@mail.gmail.com>
On Thu, Nov 26, 2009 at 3:48 AM, Sebastian Andersson <bofh69@gmail.com>wrote: > If the client is sending too much data to the server, I don't want it > to be disconnected just because some buffer is temporarily full, but > that is the required semantics of the API. If my application must send > out a lot of data, I don't want my applications to have to guess the > networking bandwidth, the browser's buffer quota and the server's > capacity and throttle my sending. Let me, the developer, be able to > say what I want to do if the server/network can't swallow my messages > fast enough. One way is to let Send return false without closing the > WebSocket > I believe that is too error-prone. My experience with APIs that allow partial writes (like class Unix "write") is that people sometimes forget to check the return value. During testing, the writes always complete (because the disk is large, or the network is fast), then in the field you get mysterious random failures. There is a way to throttle your writes if you want to. Just check 'bufferedAmount' and stop sending when that value gets too large. http://dev.w3.org/html5/websockets/#dom-websocket-bufferedamount Rob -- "He was pierced for our transgressions, he was crushed for our iniquities; the punishment that brought us peace was upon him, and by his wounds we are healed. We all, like sheep, have gone astray, each of us has turned to his own way; and the LORD has laid on him the iniquity of us all." [Isaiah 53:5-6]
Received on Wednesday, 25 November 2009 23:05:12 UTC