Skip to content

Commit

Permalink
images fix in ch8
Browse files Browse the repository at this point in the history
  • Loading branch information
gAmUssA committed Dec 5, 2012
1 parent 0fa4870 commit 2f0eedd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Chapter_8_Replacing_HTTP_With_WebSockets.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ The HTTP protocol is the lingua franca of today's Web applications, where clien

With _short polling_, your client code sends requests to the server every N seconds. The response is «empty» if there is no update as illustrated in Figure 8-1. Visualize a child seating on back seat of your car and asking, "Are we where?" every minute. And you're politely replying "Not just yet" - compare it to a empty server response. There is no valuable payload for this kid, but she's still receiving some "metadata". HTTP polling does the same thing that generates verbose HTTP response headers sending empty payload. Let alone destructing the driver (think the server) from performing other responsibilities.

image:fig_08_01.png[image]
image:images/fig_08_01.png[image]

Figure 8-1 Short polling

Expand All @@ -37,7 +37,7 @@ We'll give you one more analogy to compare short and long polling. Imagine a par

From HTTP specification perspective this "hack" is legit: long polling server behavior indistinguishable from the «slow» server. That is why this technique also referred as "Hanging GET". If you see an online auction that automatically modifies the prices as people bid on the item it looks as if the server pushes the data to you. But most likely, this functionality was implemented using long polling, which is not a real server-side data push, but its emulation.

image:fig_08_02.png[image]
image:images/fig_08_02.png[image]

Figure 8-2 Long polling

Expand All @@ -47,7 +47,7 @@ TODO Compare pros and cons of long vs short polling

Client sends the request, server wait for events and streams +multipart/chunked+ response, and then waits for the events. The server pushes the data to the client pretending that the response never ends. The response is continually appended by the server, usually with `<script>` what gets executed even after the HTTP DOM object is ready

image:fig_08_03.png[image]
image:images/fig_08_03.png[image]

Figure 8-3 HTTP streaming

Expand Down

0 comments on commit 2f0eedd

Please sign in to comment.