/lists.whatwg.org/pipermail/whatwg-whatwg.org/2010-March/068026.html
https://github.com/whatwg/whatwg.org · HTML · 94 lines · 82 code · 5 blank · 7 comment · 0 complexity · 237b55e2327375489e0eb4072ca2623f 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=%3C4BB3C9D8.8010100%40mit.edu%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="068025.html">
- <LINK REL="Next" HREF="068027.html">
- </HEAD>
- <BODY BGCOLOR="#ffffff">
- <H1>[whatwg] WebSocket bufferedAmount includes overhead or not</H1>
- <!--htdig_noindex-->
- <B>Boris Zbarsky</B>
- <A HREF="mailto:whatwg%40lists.whatwg.org?Subject=Re%3A%20%5Bwhatwg%5D%20WebSocket%20bufferedAmount%20includes%20overhead%20or%20not&In-Reply-To=%3C4BB3C9D8.8010100%40mit.edu%3E"
- TITLE="[whatwg] WebSocket bufferedAmount includes overhead or not">bzbarsky at MIT.EDU
- </A><BR>
- <I>Wed Mar 31 15:16:56 PDT 2010</I>
- <P><UL>
- <LI>Previous message: <A HREF="068025.html">[whatwg] WebSocket bufferedAmount includes overhead or not
- </A></li>
- <LI>Next message: <A HREF="068027.html">[whatwg] WebSocket bufferedAmount includes overhead or not
- </A></li>
- <LI> <B>Messages sorted by:</B>
- <a href="date.html#68026">[ date ]</a>
- <a href="thread.html#68026">[ thread ]</a>
- <a href="subject.html#68026">[ subject ]</a>
- <a href="author.html#68026">[ author ]</a>
- </LI>
- </UL>
- <HR>
- <!--/htdig_noindex-->
- <!--beginarticle-->
- <PRE>On 3/31/10 2:38 AM, Jonas Sicking wrote:
- ><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>
- Sure, but do they expect the cleanup to happen if the setup did not if
- doOtherThings tried to send() stuff?
- More to the point, is send() allowed to actually send anything when
- called, or does it have to buffer it all until the next time you get to
- the event loop?
- -Boris
- </PRE>
- <!--endarticle-->
- <!--htdig_noindex-->
- <HR>
- <P><UL>
- <!--threads-->
- <LI>Previous message: <A HREF="068025.html">[whatwg] WebSocket bufferedAmount includes overhead or not
- </A></li>
- <LI>Next message: <A HREF="068027.html">[whatwg] WebSocket bufferedAmount includes overhead or not
- </A></li>
- <LI> <B>Messages sorted by:</B>
- <a href="date.html#68026">[ date ]</a>
- <a href="thread.html#68026">[ thread ]</a>
- <a href="subject.html#68026">[ subject ]</a>
- <a href="author.html#68026">[ 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>