Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Socket.IO Introduction

orisano
December 04, 2018

Socket.IO Introduction

orisano

December 04, 2018
Tweet

More Decks by orisano

Other Decks in Technology

Transcript

  1. Socket.IO • FEATURING THE FASTEST AND MOST RELIABLE REAL-TIME ENGINE

    • ૣͯ͘৴པͰ͖ΔϦΞϧλΠϜΤϯδϯ • ϦΞϧλΠϜͰ૒ํ޲ͷevent-basedͳ௨৴
  2. Engine.IO • 0 open, αʔό͔Β࠷ॳʹૹΒΕͯ͘Δ • 1 close, ੾அ͢Δͱ͖ʹૹΔ •

    2 ping, ͪ͜Β͔ΒૹΔੜଘใࠂ • 3 pong, pingΛड͚औͬͨ࣌ʹαʔό͔Βฦͬͯ͘Δ • 4 message, σʔλΛૹड৴͢Δ࣌ʹ࢖͏ • 5 upgrade, transportΛม͑Δ࣌ʹૹΔ • 6 noop, ͳʹ΋͠ͳ͍
  3. Engine.IO • < 0******* // open • > 2 //

    ping • < 3 // pong • > 4hello. engine.io // message • < 4reply:hello
  4. Socket.IO • 0 CONNECT, αʔό͔Β࠷ॳʹૹΒΕͯ͘Δ • 1 DISCONNECT, ੾அ͢Δͱ͖ʹૹΔ •

    2 EVENT, Πϕϯτ͕ى͖ͨ࣌ʹૹड৴͢Δ • 3 ACK,ಛఆͷύέοτʹରͯ͠ฦ৴͢Δ࣌ʹ࢖͏ • 4 ERROR,Τϥʔ͕ى͖ͨ࣌ʹ࢖͏ • 5 BINARY_EVENT, όΠφϦΛૹΔ࣌͸ͬͪ͜ • 6 BINARY_ACK, όΠφϦΛฦ࣌͢͸ͬͪ͜
  5. Socket.IO • > 0 // e:open • > 40 //

    e:message s:connect • < 42[“message”,”hello”] // e:message s:event data • > 42[“reply”,”?hello”] // e:message s:event data • < 41 // e:message s:disconnect • < 42[“message”,”hello”] // e:message s:event data • < 40 // e:message s:connect • < 42[“message”,”hello”] // e:message s:event data • > 42[“reply”,”?hello”] // e:message s:event data