前田経一

Web Socketsでは、HTTPに代わるWeb Socketsのコネクションを確立すれば、send()メソッドでクライアントからサーバに任意のデータを送ることができるほか、逆にonmessage()メソッドでサーバからデータを受け取れる。

Web Socketsは、AjaxやCometに比べてシンプルであることが最大のメリットだが、このほかにも通信トラフィックを抑えられるメリットがあるという。Web Socketsプロトコル(ws://というURIスキームを使う)では、いったんコネクションが確立すると、HTTP上でCometを使うのと異なり、HTTPヘッダのオーバーヘッドがない。Google Chromeのプロダクトマネージャ、イアン・フェット(Ian Fette)氏の解説によれば、チャットサーバに対して「hi」と送るだけの通信であっても、CometではHTTPヘッダやクッキーのために容易に1KB程度に膨れあがる。一方、Web Socketsであれば、数バイトで済む。これは同時接続ユーザー数が少ない場合には問題とならないが、数十万ユーザーや数億ユーザーとなってくると大きな違いが出てくるのだという。

  1. compozz reblogged this from gkojay
  2. bettergin reblogged this from takaakik
  3. joker1007 reblogged this from takaakik
  4. papertips reblogged this from gkojay
  5. takaakik reblogged this from gkojay
  6. gkojay reblogged this from nakano
  7. keiichimaeda reblogged this from otsune
  8. nobby0-0 reblogged this from yaruo
  9. mailaddr reblogged this from otsune
  10. mailaddr reblogged this from otsune
  11. fifty-six reblogged this from yaruo
  12. knnr reblogged this from yaruo
  13. keigo reblogged this from otsune
  14. atm09td reblogged this from kazupon
  15. heboreal reblogged this from nakano
  16. nakamushi reblogged this from otsune
  17. nakamushi reblogged this from otsune
  18. wiv8 reblogged this from otsune
  19. zaiga reblogged this from yaruo
  20. ukar reblogged this from otsune
  21. adnm reblogged this from yaruo
  22. kazupon reblogged this from otsune
  23. e-tag reblogged this from otsune
  24. otsune reblogged this from vmconverter
  25. ihstyle reblogged this from yaruo
  26. wackey reblogged this from yaruo
  27. yaruo reblogged this from tiga
  28. nov94 reblogged this from nakano
  29. vmconverter reblogged this from hexe
  30. tiga reblogged this from nakano
  31. hexe reblogged this from nakano
  32. nakano posted this