|
|
|
var socket = io();
|
|
/*Initializing the connection with the server via websockets */
|
|
socket.emit('ackMessage', "true");
|
|
socket.on("jsonHoneycomb",function(message){
|
|
/*
|
|
When server sends data to the client it will trigger "message" event on the client side , by
|
|
using socket.on("message") , one cna listen for the ,message event and associate a callback to
|
|
be executed . The Callback function gets the dat sent from the server
|
|
*/
|
|
console.log("Message from the server arrived")
|
|
var honeyCells = JSON.parse(message);
|
|
populateHoneycomb( honeyCells );
|
|
socket.emit('ackMessage', "true");
|
|
|
|
});
|
|
|
|
|