lib/sdam/topology.js
function destroyServer(server, topology, callback) {
  LOCAL_SERVER_EVENTS.forEach(event => server.removeAllListeners(event));

  server.destroy(() => {
    topology.emit(
      'serverClosed',
      new monitoring.ServerClosedEvent(topology.s.id, server.description.address)
    );

    if (typeof callback === 'function') callback(null, null);
  });
}
function destroyServer(server, topology, callback) {
  LOCAL_SERVER_EVENTS.forEach(event => server.removeAllListeners(event));

  server.destroy(() => {
    topology.emit(
      'serverClosed',
      new monitoring.ServerClosedEvent(topology.s.id, server.description.address)
    );

    if (typeof callback === 'function') callback(null, null);
  });
}
function destroyServer ( server , topology , callback ) { LOCAL_SERVER_EVENTS . forEach ( event => server . removeAllListeners ( event ) ) ; server . destroy ( ( ) => { topology . emit ( 'serverClosed' , new monitoring . ServerClosedEvent ( topology . s . id , server . description . address ) ) ; if ( typeof callback === 'function' ) callback ( null , null ) ; } ) ; }
Destroys a server, and removes all event listeners from the instance

@param {Server} server
Destroys a server and removes all event listeners from the instance