FAQ
I try to send messages from a server to a web browser.
http://play.golang.org/p/ifxCi2dD7l

When I use handler h1, then server sends messages to browser infinitely
often (1msg/sec.)
When I use handler h2, then I get error (connection lost) after 26
iterations.

What is wrong with handler h2 ?

michal

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • Caleb Doxsey at Mar 14, 2013 at 5:21 am
    The issue with your code is you are not adding the chunked transfer
    encoding headers:

    http://en.wikipedia.org/wiki/Chunked_transfer_encoding

    When you hijack the connection none of the HTTP magic is done for you
    anymore. A good strategy for problems like this is to use a program like
    Wireshark to see what the actual bytes being sent are. (So in this case you
    could run the two examples and compare how they differ)
    On Wednesday, March 13, 2013 7:09:32 AM UTC-7, mic...@zeto.wroc.pl wrote:

    I try to send messages from a server to a web browser.
    http://play.golang.org/p/ifxCi2dD7l

    When I use handler h1, then server sends messages to browser infinitely
    often (1msg/sec.)
    When I use handler h2, then I get error (connection lost) after 26
    iterations.

    What is wrong with handler h2 ?

    michal
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Michal at Mar 14, 2013 at 6:46 am
    Thank you.

    michal

    W dniu środa, 13 marca 2013 15:09:32 UTC+1 użytkownik mic...@zeto.wroc.pl
    napisał:
    I try to send messages from a server to a web browser.
    http://play.golang.org/p/ifxCi2dD7l

    When I use handler h1, then server sends messages to browser infinitely
    often (1msg/sec.)
    When I use handler h2, then I get error (connection lost) after 26
    iterations.

    What is wrong with handler h2 ?

    michal
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedMar 13, '13 at 2:09p
activeMar 14, '13 at 6:46a
posts3
users2
websitegolang.org

2 users in discussion

Michal: 2 posts Caleb Doxsey: 1 post

People

Translate

site design / logo © 2022 Grokbase