Socket.io
web sockets
- bidirectional com protocol with client and server over TCP
Socket.io
- library for real-time dubplex communication
- uses
websocket protocol for interface
- client side: library in the browser
- server side: library in node.js
connections
- TCP -> connect directly to server with keep-alive connection
- socket.io -> connect over http, kept alive by websocket protocol
messaging
- uses same as node events,
emit() and on()
- socket.io allows for shared events with ‘disconnected’ participants through a server
- clients connect, emit events, respond to events from server
process
- clients connect to a socket on a server
- a client speaks to the server
- server listens for
speak
- server does a
broadcast or emit
- other cliens that may be able to
hear on that message as well
additional