//emitted when server closes ...not emitted until all connections closes.
console.log("Listening at :3000...");
server.on('close',function(){
console.log('Server closed !');
});
});
Socketio.on("connection",socket=>{
// emitted when new client connects
console.log('new Socket connect: ',socket.id);
server.on('connection',function(socket){
socket.on("newGame",data=>{
print("New Game");
//this property shows the number of characters currently buffered to be written. (Number of characters is approximately equal to the number of bytes to be written, but the buffer may contain strings, and the strings are lazily encoded, so the exact number of bytes is not known.)
//Users who experience large or growing bufferSize should attempt to "throttle" the data flows in their program with pause() and resume().