/lists.whatwg.org/pipermail/whatwg-whatwg.org/2010-March/068027.html
https://github.com/whatwg/whatwg.org · HTML · 100 lines · 89 code · 4 blank · 7 comment · 0 complexity · 4a16b46bfd32052a0661e136e7d55158 MD5 · raw file
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
- <HTML>
- <HEAD>
- <TITLE> [whatwg] WebSocket bufferedAmount includes overhead or not
- </TITLE>
- <LINK REL="Index" HREF="index.html" >
- <LINK REL="made" HREF="mailto:whatwg%40lists.whatwg.org?Subject=Re%3A%20%5Bwhatwg%5D%20WebSocket%20bufferedAmount%20includes%20overhead%20or%20not&In-Reply-To=%3Ck2i63df84f1003311557of6e198fesd792b509b8eec285%40mail.gmail.com%3E">
- <META NAME="robots" CONTENT="index,nofollow">
- <style type="text/css">
- pre {
- white-space: pre-wrap; /* css-2.1, curent FF, Opera, Safari */
- }
- </style>
- <META http-equiv="Content-Type" content="text/html; charset=us-ascii">
- <LINK REL="Previous" HREF="068026.html">
- <LINK REL="Next" HREF="068010.html">
- </HEAD>
- <BODY BGCOLOR="#ffffff">
- <H1>[whatwg] WebSocket bufferedAmount includes overhead or not</H1>
- <!--htdig_noindex-->
- <B>Jonas Sicking</B>
- <A HREF="mailto:whatwg%40lists.whatwg.org?Subject=Re%3A%20%5Bwhatwg%5D%20WebSocket%20bufferedAmount%20includes%20overhead%20or%20not&In-Reply-To=%3Ck2i63df84f1003311557of6e198fesd792b509b8eec285%40mail.gmail.com%3E"
- TITLE="[whatwg] WebSocket bufferedAmount includes overhead or not">jonas at sicking.cc
- </A><BR>
- <I>Wed Mar 31 15:57:57 PDT 2010</I>
- <P><UL>
- <LI>Previous message: <A HREF="068026.html">[whatwg] WebSocket bufferedAmount includes overhead or not
- </A></li>
- <LI>Next message: <A HREF="068010.html">[whatwg] WebSocket bufferedAmount includes overhead or not
- </A></li>
- <LI> <B>Messages sorted by:</B>
- <a href="date.html#68027">[ date ]</a>
- <a href="thread.html#68027">[ thread ]</a>
- <a href="subject.html#68027">[ subject ]</a>
- <a href="author.html#68027">[ author ]</a>
- </LI>
- </UL>
- <HR>
- <!--/htdig_noindex-->
- <!--beginarticle-->
- <PRE>On Wed, Mar 31, 2010 at 3:16 PM, Boris Zbarsky <<A HREF="http://lists.whatwg.org/listinfo.cgi/whatwg-whatwg.org">bzbarsky at mit.edu</A>> wrote:
- ><i> On 3/31/10 2:38 AM, Jonas Sicking wrote:
- </I>>><i>
- </I>>><i> I would have expected bufferedAmount to only change as a result of an
- </I>>><i> event being posted to the main event loop. We generally try to avoid
- </I>>><i> "racy" variables since people don't expect them. Consider for example
- </I>>><i>
- </I>>><i> if (ws.bufferedAmount>  X) {
- </I>>><i>   setUpSomeState();
- </I>>><i> }
- </I>>><i>
- </I>>><i> try {
- </I>>><i>   doOtherThings();
- </I>>><i> }
- </I>>><i> finally {
- </I>>><i>   if (ws.bufferedAmount>  X) {
- </I>>><i>     cleanUpState();
- </I>>><i>   }
- </I>>><i> }
- </I>>><i>
- </I>>><i> I'd imagine most JS developers to expect the cleanup to always happen
- </I>>><i> if the setup did.
- </I>><i>
- </I>><i> Sure, but do they expect the cleanup to happen if the setup did not if
- </I>><i> doOtherThings tried to send() stuff?
- </I>><i>
- </I>><i> More to the point, is send() allowed to actually send anything when called,
- </I>><i> or does it have to buffer it all until the next time you get to the event
- </I>><i> loop?
- </I>
- I would expect that send() is allowed to start streaming data over the
- network as soon as it can, but only update bufferedAmount from the
- event loop.
- / Jonas
- </PRE>
- <!--endarticle-->
- <!--htdig_noindex-->
- <HR>
- <P><UL>
- <!--threads-->
- <LI>Previous message: <A HREF="068026.html">[whatwg] WebSocket bufferedAmount includes overhead or not
- </A></li>
- <LI>Next message: <A HREF="068010.html">[whatwg] WebSocket bufferedAmount includes overhead or not
- </A></li>
- <LI> <B>Messages sorted by:</B>
- <a href="date.html#68027">[ date ]</a>
- <a href="thread.html#68027">[ thread ]</a>
- <a href="subject.html#68027">[ subject ]</a>
- <a href="author.html#68027">[ author ]</a>
- </LI>
- </UL>
- <hr>
- <a href="http://lists.whatwg.org/listinfo.cgi/whatwg-whatwg.org">More information about the whatwg
- mailing list</a><br>
- <!--/htdig_noindex-->
- </body></html>