title: why socket.disconnect() on client side doesn't fire disconnect event on the server?
body: <blockquote>
  <pre><code>I SOLVED MY PROBLEM WİTH THİS CODE BLOCK
  
  
  var io = require('socket.io')(server, {
    pingInterval: 10000,
    pingTimeout: 5000,
  }).listen(server)
  </code></pre>
  </blockquote>
  
  <p>I am making chat app with socket.io. But if i dont make event in 15 or 20 sec , my app disconnect to socket.io. I would like to  just disconnect when app closed</p>
  
  <p>Server side code;</p>
  
  <pre><code>var server = http.createServer(app);
  var io = require('socket.io').listen(server);
  
  io.on('connection', function(socket){
  let chatroom;
  console.log("User Connected");
  io.sockets.emit('connected', "12345");
  socket.on('chatRoom', function(room) {
  socket.join(room);
  chatroom = room;
  });
  
  socket.on('messageData', function(msg){
    io.sockets.in(chatroom).emit('messageData', msg);
  });
   socket.on('disconnect', function(msg){
    console.log("User DisConnected"); 
  });
  
  });
  </code></pre>
  
  <p>Client Side Socket Class</p>
  
  <pre><code>import React, { Component } from 'react';
  import io from "socket.io-client";
  
  class socketio extends Component{
  
  
      static socketConnect = () =&gt;{
         this.socket=io("http://xxx.xxx.xxx.xxx:3000",{jsonp:false});
      }
  
      static getSocket = () =&gt;{
          return this.socket;
      }
  }
  
  export default socketio;
  </code></pre>
  
  <p>Client Side Chat Screen Code;</p>
  
  <pre><code>import socketio from '../Classes/socketio';
  this.socket = socketio.getSocket();
  
        this.socket.emit('chatRoom', this.state.chatID);
  
              this.socket.on("messageData",(data) =&gt;{               
  
              });
  </code></pre>