Socket.io - andrewkyllo-401-advanced-javascript/seattle-javascript-401d34 GitHub Wiki
Web Sockets
- A communication protocol which provides bidirectional communication between the client ad the server over a tcp connection.
- Web sockets remain open all the time.
- Waits for client or server to terminate request
Socket.io
- A library which enables real-time and full duplex communication between the client and the web servers
- Uses websocket protocol to provide the interface
- Client Side: it is the library that runs inside the browser
- Server Side: It is the library for Node.js
Connections
- With TCP, you connect directly to a server with a keep-alive type of connection
- With Socket-io you connect to a server over HTTP. THe session is kept alive through itsinternal use of the websocket protocol
Messaging
- Standard node events are sent with emit() and received with on()