/lists.whatwg.org/pipermail/whatwg-whatwg.org/2010-March/025753.html

https://github.com/whatwg/whatwg.org · HTML · 89 lines · 77 code · 5 blank · 7 comment · 0 complexity · 4bbd9dbdb2b3c192b2a4a3c92b4474ea MD5 · raw file

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