Remove the audio plugins loaded and closes connection with mod-host.

        .. note::

            If the mod-host process has been created with :meth:`~pluginsmanager.observer.mod_host.ModHost.start()`
            method, it will be finished.
170601
def close(self):
        
        if self.host is None:
            raise ModHostError('There is no established connection with mod-host. '
                               'Did you call the `connect()` method?')

        super(ModHost, self).close()

        if self._started_with_this_api:
            self.host.quit()
        else:
            self.host.close()
155413
private void cleanupConnection(TaskListener listener) {
        // we might be called multiple times from multiple finally/catch block, 
        if (connection!=null) {
            connection.close();
            connection = null;
            listener.getLogger().println(Messages.SSHLauncher_ConnectionClosed(getTimestamp()));
        }
    }
141183
void stop( Instance instance, PluginInterface plugin ) throws IOException {

		String instancePath = InstanceHelpers.computeInstancePath( instance );
		if( instance.getStatus() != InstanceStatus.DEPLOYED_STARTED )
			this.logger.fine( instancePath + " cannot be stopped. Prerequisite status: DEPLOYED_STARTED (but was " + instance.getStatus() + ")." );
		else
			stopInstance( instance, plugin, false );
	}
606650
def close(self):
        
        if (self.__ser is not None):
            self.__ser.close()
        if (self.__tcpClientSocket is not None):
            self.__stoplistening = True
            self.__tcpClientSocket.shutdown(socket.SHUT_RDWR)
            self.__tcpClientSocket.close()
        self.__connected = False
834591
function stopAudioCapture() {

        // Disconnect media source node from script processor
        if (source)
            source.disconnect();

        // Disconnect associated script processor node
        if (processor)
            processor.disconnect();

        // Stop capture
        if (mediaStream) {
            var tracks = mediaStream.getTracks();
            for (var i = 0; i < tracks.length; i++)
                tracks[i].stop();
        }

        // Remove references to now-unneeded components
        processor = null;
        source = null;
        mediaStream = null;

        // End stream
        writer.sendEnd();

    }
1278243
def release_plugin(self, name):
        
        plugin = self._active_plugins[name]
        if id(plugin) in self._provided_by_preset:
            self._provided_by_preset.remove(id(plugin))

        del self._active_plugins[name]
        delattr(self, name)
616118
def disconnect(self):
        """"""
        try:
            self.cleanup()
            if self.protocol == "ssh":
                self.paramiko_cleanup()
            elif self.protocol == "telnet":
                self.remote_conn.close()
            elif self.protocol == "serial":
                self.remote_conn.close()
        except Exception:
            # There have been race conditions observed on disconnect.
            pass
        finally:
            self.remote_conn_pre = None
            self.remote_conn = None
            self.close_session_log()
180531
public void disconnect(){
        if(timer != null){
            timer.cancel();
        }
        if (ws != null && ws.isOpen()) {
            ws.disconnect();
            subscribedTokens = new HashSet<>();
            modeMap.clear();
        }
    }
325735
public void stopAllPlugins() {
        synchronized (pluginMap) {
            // remove the listener for this repository
            loggerRepository.removeLoggerRepositoryEventListener(listener);

            Iterator iter = pluginMap.values().iterator();

            while (iter.hasNext()) {
                Plugin plugin = (Plugin) iter.next();
                plugin.shutdown();
                firePluginStopped(plugin);
            }
        }
    }
277084
def close(self):
        
        if self.connection:
            logging.info("Closing connection to {}.".format(self.host))
            self.connection.close()
            self.connection = None
968670
private void doStartPlaying()
	{
		if (currentContainer!=null)
		{
			doStopPlaying();
			if (currentContainer instanceof ModContainer)
			{
				System.out.println(((ModContainer) currentContainer).getCurrentMod().toString());
			}
			Mixer mixer = createNewMixer();
			mixer.setExportFile(wavFileName);
			playerThread = new PlayThread(mixer, this);
			playerThread.start();
		}
	}
792162
def cleanup():
    
    _log.debug("P4P atexit begins")
    # clean provider registry
    from .server import clearProviders, _cleanup_servers
    clearProviders()

    # close client contexts
    from .client.raw import _cleanup_contexts
    _cleanup_contexts()

    # stop servers
    _cleanup_servers()

    # shutdown default work queue
    from .util import _defaultWorkQueue
    _defaultWorkQueue.stop()
    _log.debug("P4P atexit completes")
9385
def close(self):
        
        if self.is_open:
            message_input = UnityMessage()
            message_input.header.status = 400
            self.unity_to_external.parent_conn.send(message_input)
            self.unity_to_external.parent_conn.close()
            self.server.stop(False)
            self.is_open = False
1288242
protected void shutdownImpl(ShutdownModeAmp mode, Result<Boolean> result)
  {
    Thread thread = Thread.currentThread();
    ClassLoader oldLoader = thread.getContextClassLoader();
    
    I oldInstance = _instance;
    
    if (oldInstance == null) {
      result.ok(true);
      return;
    }
    
    boolean isStopping = false;

    try {
      thread.setContextClassLoader(oldInstance.classLoader());
      
      isStopping = _lifecycle.toStopping();

      _lifecycle.toStop();

      if (! isStopping) {
        return;
      }

      _instance = null;

      oldInstance.shutdown(mode);
      
      result.ok(true);
    } catch (Throwable e) {
      result.fail(e);
    } finally {
      thread.setContextClassLoader(oldLoader);
    }
  }
190947
public void close() {
        Thread responseThread = null;
        synchronized (this) {
            if (!closed) {
                closed = true;
                notifyAll();

                if (listenForCommands) {
                    listenForCommands = false;
                    if (listeningThread != null) {
                        listeningThread.interrupt();
                    }
                }

                Utils.tryToClose(serverSocketChannel);
                commandFile.delete();

                responseThread = this.responseThread.getAndSet(null);
            }
        }

        if (responseThread != null) {
            try {
                responseThread.join();
            } catch (InterruptedException ex) {
            }
        }
    }
960234
public void open() throws ModbusException {

        // Start the listener if it isn' already running

        if (!isRunning) {
            try {
                listenerThread = new Thread(listener);
                listenerThread.start();
                isRunning = true;
            }
            catch (Exception x) {
                closeListener();
                throw new ModbusException(x.getMessage());
            }
        }
    }
1226693
def close_connection(self):
        
        self.logger.debug("Close CLI Process '%s'" % self.cmd, extra={'type': '<->'})
        self.stop_process()