Terminate socket connection because of stopping loop

		:return: None
973827
def loop_stopped(self):
		
		transport = self.transport()
		if self.server_mode() is True:
			transport.close_server_socket(self.config())
		else:
			transport.close_client_socket(self.config())
1096811
def disconnect(self):
    """"""
    if self.sock is not None:
      try:
        self.sock.close()
      except socket.error:
        pass
      finally:
        self.sock = None
1081095
def close_socket(sock):
    ''''''
    if sock:
        try:
            sock.shutdown(socket.SHUT_RDWR)
        except Exception:
            pass
        try:
            sock.close()
        except Exception:
            pass
780584
public synchronized void stop() {
		running = false;
		pool.shutdown();
		try {
			if (!pool.awaitTermination(60, TimeUnit.SECONDS))
				pool.shutdownNow();
			if (!serverSocket.isClosed())
				this.serverSocket.close();
		} catch (IOException e) {
			DBP.printerror("Error closing Socket.");
			DBP.printException(e);
		} catch (InterruptedException ie) {
			DBP.printerror("Error shutting down threadpool.");
			DBP.printException(ie);
			// (Re-)Cancel if current thread also interrupted
			pool.shutdownNow();
			// Preserve interrupt status
			Thread.currentThread().interrupt();
		}
	}
782942
async def stop(self):
        

        if self._connection_task is None:
            return

        try:
            await self._connection_task.stop()
        finally:
            self._con = None
            self._connection_task = None
            self._manager.clear()
422931
def stop(self):
        """"""
        self.ready = False
        if self._start_time is not None:
            self._run_time += (time.time() - self._start_time)
        self._start_time = None

        sock = getattr(self, 'socket', None)
        if sock:
            if not isinstance(self.bind_addr, six.string_types):
                # Touch our own socket to make accept() return immediately.
                try:
                    host, port = sock.getsockname()[:2]
                except socket.error as ex:
                    if ex.args[0] not in errors.socket_errors_to_ignore:
                        # Changed to use error code and not message
                        # See
                        # https://github.com/cherrypy/cherrypy/issues/860.
                        raise
                else:
                    # Note that we're explicitly NOT using AI_PASSIVE,
                    # here, because we want an actual IP to touch.
                    # localhost won't work if we've bound to a public IP,
                    # but it will if we bound to '0.0.0.0' (INADDR_ANY).
                    for res in socket.getaddrinfo(
                        host, port, socket.AF_UNSPEC,
                        socket.SOCK_STREAM,
                    ):
                        af, socktype, proto, canonname, sa = res
                        s = None
                        try:
                            s = socket.socket(af, socktype, proto)
                            # See
                            # https://groups.google.com/group/cherrypy-users/
                            #     browse_frm/thread/bbfe5eb39c904fe0
                            s.settimeout(1.0)
                            s.connect((host, port))
                            s.close()
                        except socket.error:
                            if s:
                                s.close()
            if hasattr(sock, 'close'):
                sock.close()
            self.socket = None

        self.requests.stop(self.shutdown_timeout)
220624
def stop(self):
                
        if self.is_alive():
            self._proc.terminate()
            
        if self._proc is not None:
            self.__cleanup()
                   
            if self.raise_error:
                if self._proc.exitcode == 255:
                    raise LoopExceptionError("the loop function return non zero exticode ({})!\n".format(self._proc.exitcode)+
                                             "see log (INFO level) for traceback information")
        self.pipe_handler.close()
        self._proc = None
1336753
def stop_loop(self):
        """"""
        hub.kill(self._querier_thread)
        self._querier_thread = None
        self._datapath = None
        self.logger.info("stopped a querier.")
1292396
async def disconnect(self, abort=False):
        
        if self.state == 'connected':
            await self._send_packet(packet.Packet(packet.CLOSE))
            await self.queue.put(None)
            self.state = 'disconnecting'
            await self._trigger_event('disconnect', run_async=False)
            if self.current_transport == 'websocket':
                await self.ws.close()
            if not abort:
                await self.read_loop_task
            self.state = 'disconnected'
            try:
                client.connected_clients.remove(self)
            except ValueError:  # pragma: no cover
                pass
        self._reset()
350245
def disconnect(self):
        
        self._parser.on_disconnect()
        if self._sock is None:
            return
        try:
            self._sock.shutdown(socket.SHUT_RDWR)
            self._sock.close()
        except socket.error:
            pass
        self._sock = None
1344213
def close_socket(self):
        ''''''
        log.debug("Closing socket")
        if self.sock:
            try:
                self.sock.close()
            except:
                pass

            self.sock = None
64378
def close(self):
        

        # Close the underlying socket
        if self._sock:
            with utils.ignore_except():
                self._sock.close()
            self._sock = None

        # Purge the message buffers
        self._recvbuf = []
        self._recvbuf_partial = ''
845856
def terminate(self):
        
        rs = self.connection.terminate_instances([self.id])
        if len(rs) > 0:
            self._update(rs[0])
1113473
def stop(self, terminate=False):
        

        if not self.__online:
            raise foundations.exceptions.ServerOperationError(
                "{0} | '{1}' TCP Server is not online!".format(self.__class__.__name__, self))

        if not terminate:
            self.__server.shutdown()
        else:
            self.__server._BaseServer__shutdown_request = True

        self.__server = None
        self.__worker = None
        self.__online = False

        LOGGER.info("{0} | TCP Server successfully stopped!".format(self.__class__.__name__))
        return True
985916
def _abort(self) -> None:
        """"""
        self.client_terminated = True
        self.server_terminated = True
        if self.stream is not None:
            self.stream.close()  # forcibly tear down the connection
        self.close()
308951
async def stop(self):
        """"""
        self._shutdown = True

        if self.wsck:
            _LOGGER.info('Closing Emby server websocket.')
            await self.wsck.close()
            self.wsck = None

        if self._own_loop:
            _LOGGER.info("Shutting down Emby server loop...")
            self._event_loop.call_soon_threadsafe(self._event_loop.stop)
50040
def send_stop_signal(self, silent=False):
        
        if self.is_running():
            self._stop_signal = True
        elif not silent:
            raise RuntimeError('Loop is currently not running')