stop() {
        return new Promise(resolve => {
            if (this.socket) {
                this.socket.close(() => {
                    resolve(true);
                });
            } else {
                resolve(true);
            }
        });
    }
/**
     * Stop Discovery server
     *
     * @returns {Promise<boolean>} Resolves with true if successfully stopped
     */
Stop Discovery server
@returns {Promise} Resolves with true if successfully stopped
Stop Discovery server @returns { Promise } Resolves with true if successfully stopped
stop() {
        return new Promise(resolve => {
            if (this.socket) {
                this.socket.close(() => {
                    resolve(true);
                });
            } else {
                resolve(true);
            }
        });
    }
stop ( ) { return new Promise ( resolve => { if ( this . socket ) { this . socket . close ( ( ) => { resolve ( true ) ; } ) ; } else { resolve ( true ) ; } } ) ; }
Stop Discovery server
 @returns {Promise<boolean>} Resolves with true if successfully stopped
Stop Discovery server @returns { Promise<boolean > } Resolves with true if successfully stopped