/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

  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2. <HTML>
  3. <HEAD>
  4. <TITLE> [whatwg] WebSocket bufferedAmount includes overhead or not
  5. </TITLE>
  6. <LINK REL="Index" HREF="index.html" >
  7. <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">
  8. <META NAME="robots" CONTENT="index,nofollow">
  9. <style type="text/css">
  10. pre {
  11. white-space: pre-wrap; /* css-2.1, curent FF, Opera, Safari */
  12. }
  13. </style>
  14. <META http-equiv="Content-Type" content="text/html; charset=us-ascii">
  15. <LINK REL="Previous" HREF="068025.html">
  16. <LINK REL="Next" HREF="068027.html">
  17. </HEAD>
  18. <BODY BGCOLOR="#ffffff">
  19. <H1>[whatwg] WebSocket bufferedAmount includes overhead or not</H1>
  20. <!--htdig_noindex-->
  21. <B>Boris Zbarsky</B>
  22. <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"
  23. TITLE="[whatwg] WebSocket bufferedAmount includes overhead or not">bzbarsky at MIT.EDU
  24. </A><BR>
  25. <I>Wed Mar 31 15:16:56 PDT 2010</I>
  26. <P><UL>
  27. <LI>Previous message: <A HREF="068025.html">[whatwg] WebSocket bufferedAmount includes overhead or not
  28. </A></li>
  29. <LI>Next message: <A HREF="068027.html">[whatwg] WebSocket bufferedAmount includes overhead or not
  30. </A></li>
  31. <LI> <B>Messages sorted by:</B>
  32. <a href="date.html#68026">[ date ]</a>
  33. <a href="thread.html#68026">[ thread ]</a>
  34. <a href="subject.html#68026">[ subject ]</a>
  35. <a href="author.html#68026">[ author ]</a>
  36. </LI>
  37. </UL>
  38. <HR>
  39. <!--/htdig_noindex-->
  40. <!--beginarticle-->
  41. <PRE>On 3/31/10 2:38 AM, Jonas Sicking wrote:
  42. &gt;<i> I would have expected bufferedAmount to only change as a result of an
  43. </I>&gt;<i> event being posted to the main event loop. We generally try to avoid
  44. </I>&gt;<i> &quot;racy&quot; variables since people don't expect them. Consider for example
  45. </I>&gt;<i>
  46. </I>&gt;<i> if (ws.bufferedAmount&gt; X) {
  47. </I>&gt;<i> setUpSomeState();
  48. </I>&gt;<i> }
  49. </I>&gt;<i>
  50. </I>&gt;<i> try {
  51. </I>&gt;<i> doOtherThings();
  52. </I>&gt;<i> }
  53. </I>&gt;<i> finally {
  54. </I>&gt;<i> if (ws.bufferedAmount&gt; X) {
  55. </I>&gt;<i> cleanUpState();
  56. </I>&gt;<i> }
  57. </I>&gt;<i> }
  58. </I>&gt;<i>
  59. </I>&gt;<i> I'd imagine most JS developers to expect the cleanup to always happen
  60. </I>&gt;<i> if the setup did.
  61. </I>
  62. Sure, but do they expect the cleanup to happen if the setup did not if
  63. doOtherThings tried to send() stuff?
  64. More to the point, is send() allowed to actually send anything when
  65. called, or does it have to buffer it all until the next time you get to
  66. the event loop?
  67. -Boris
  68. </PRE>
  69. <!--endarticle-->
  70. <!--htdig_noindex-->
  71. <HR>
  72. <P><UL>
  73. <!--threads-->
  74. <LI>Previous message: <A HREF="068025.html">[whatwg] WebSocket bufferedAmount includes overhead or not
  75. </A></li>
  76. <LI>Next message: <A HREF="068027.html">[whatwg] WebSocket bufferedAmount includes overhead or not
  77. </A></li>
  78. <LI> <B>Messages sorted by:</B>
  79. <a href="date.html#68026">[ date ]</a>
  80. <a href="thread.html#68026">[ thread ]</a>
  81. <a href="subject.html#68026">[ subject ]</a>
  82. <a href="author.html#68026">[ author ]</a>
  83. </LI>
  84. </UL>
  85. <hr>
  86. <a href="http://lists.whatwg.org/listinfo.cgi/whatwg-whatwg.org">More information about the whatwg
  87. mailing list</a><br>
  88. <!--/htdig_noindex-->
  89. </body></html>