Disconnect from Socket.IO Server

Server

io.on('connection', function (socket) {
    console.log("Connected : " + socket.client.id);

    socket.on("disconnect", function () {
        console.log("Disconnected : " + socket.client.id);
    })
});

Client

$(document).ready(function () {
    var socket = io.connect('http://localhost:14000');
});

References
https://socket.io/docs/#Sending-and-receiving-events