View on GitHub

marymafa.github.io


layout: post title: Socket IO date: 2019-02-12 —

Socket.IO

Is a library that enables real-time, bidirectional and event-based communication between the browser and the server. It consists of:

Reliability

Connections are established even in the presence of:

example

io.on(‘connection’, function(socket){ socket.emit(‘request’, /* /); // emit an event to the socket io.emit(‘broadcast’, / /); // emit an event to all connected sockets socket.on(‘reply’, function(){ / */ }); // listen to the event });