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であれば、数バイトで済む。これは同時接続ユーザー数が少ない場合には問題とならないが、数十万ユーザーや数億ユーザーとなってくると大きな違いが出てくるのだという。
“
| — | Web SocketsでAjaxは不要になるか? - @IT (via nakano) (via hexe) (via vmconverter) (via otsune) |
-
compozz reblogged this from gkojay
-
bettergin reblogged this from takaakik
-
joker1007 reblogged this from takaakik
-
papertips reblogged this from gkojay
-
takaakik reblogged this from gkojay
-
compozz liked this
-
gkojay reblogged this from nakano
-
keiichimaeda reblogged this from otsune
-
spherical-moss liked this
-
nobby0-0 reblogged this from yaruo
-
netclip liked this
-
mailaddr reblogged this from otsune
-
mailaddr reblogged this from otsune
-
slmn liked this
-
fifty-six reblogged this from yaruo
-
sawada04 liked this
-
knnr reblogged this from yaruo
-
tomoakitachikawa liked this
-
keigo reblogged this from otsune
-
atm09td reblogged this from kazupon
-
heboreal reblogged this from nakano
-
nakamushi reblogged this from otsune
-
nakamushi reblogged this from otsune
-
wiv8 reblogged this from otsune
-
zaiga reblogged this from yaruo
-
ukar reblogged this from otsune
-
stormrider101lj liked this
-
adnm reblogged this from yaruo
-
kiyoya liked this
-
ckeiskei liked this
-
kazupon reblogged this from otsune
-
e-tag reblogged this from otsune
-
otsune reblogged this from vmconverter
-
ihstyle reblogged this from yaruo
-
kubotomo liked this
-
wackey reblogged this from yaruo
-
yaruo reblogged this from tiga
-
nov94 reblogged this from nakano
-
harunoriyukamu liked this
-
proto-jp liked this
-
vmconverter reblogged this from hexe
-
tiga reblogged this from nakano
-
clipfork liked this
-
hexe reblogged this from nakano
-
hooldboy liked this
-
nakano posted this