Sends the QUIT command to the server and breaks the connection.

@throws ezcMailTransportSmtpException
if the QUIT command failed
198448
public function disconnect()
    {
        if ( $this->status != self::STATUS_NOT_CONNECTED )
        {
            $this->sendData( 'QUIT' );
            $replyCode = $this->getReplyCode( $error ) !== '221';
            fclose( $this->connection );
            $this->status = self::STATUS_NOT_CONNECTED;
            if ( $replyCode )
            {
                throw new ezcMailTransportSmtpException( "QUIT failed with error: $error." );
            }
        }
    }
491837
def quit(self):
        """"""
        # stop all threads and close the socket
        self.receive_thread.stopped = True
        # self.receive_thread._Thread__stop()

        self.message_thread.stopped = True
        # self.message_thread._Thread__stop()

        # self.ping_thread.stopped = True
        # self.ping_thread._Thread__stop()

        self.receive_thread.join()
        _LOGGER.info('receive_thread exited')
        self.message_thread.join()
        _LOGGER.info('message_thread exited')

        self.socket.close()
627030
public function Quit($close_on_error = true) {
    $this->error = null; // so there is no confusion

    if(!$this->connected()) {
      $this->error = array(
              "error" => "Called Quit() without being connected");
      return false;
    }

    // send the quit command to the server
    fputs($this->smtp_conn,"quit" . $this->CRLF);

    // get any good-bye messages
    $byemsg = $this->get_lines();

    if($this->do_debug >= 2) {
      echo "SMTP -> FROM SERVER:" . $byemsg . $this->CRLF . '<br />';
    }

    $rval = true;
    $e = null;

    $code = substr($byemsg,0,3);
    if($code != 221) {
      // use e as a tmp var cause Close will overwrite $this->error
      $e = array("error" => "SMTP server rejected quit command",
                 "smtp_code" => $code,
                 "smtp_rply" => substr($byemsg,4));
      $rval = false;
      if($this->do_debug >= 1) {
        echo "SMTP -> ERROR: " . $e["error"] . ": " . $byemsg . $this->CRLF . '<br />';
      }
    }

    if(empty($e) || $close_on_error) {
      $this->Close();
    }

    return $rval;
  }
1177611
public function disconnect()
    {
        if (isset($this->connection)) {
            $this->connection->disconnect();
        } else {
            $this->command("QUIT\r\n");
            if (!fclose($this->socket)) {
                throw new Swift_Plugins_Pop_Pop3Exception(
                    sprintf('POP3 host [%s] connection could not be stopped', $this->host)
                );
            }
            $this->socket = null;
        }
    }
444419
public void destroy() {
		Command command = this.currentCommand.get();
		if (command != null) {
			command.setExceptionMessage("Connection has been closed");
			command.countDown();
		}
		while ((command = this.commandAlreadySent.poll()) != null) {
			command.setExceptionMessage("Connection has been closed");
			command.countDown();
		}

	}
260204
def send(self, cmd, *payload):
        

        # If it's closed, raise an error up front
        if not self._sock:
            raise ConnectionClosed("Connection closed")

        # Construct the outgoing message
        msg = json.dumps(dict(cmd=cmd, payload=payload)) + '\n'

        # Send it
        try:
            self._sock.sendall(msg)
        except socket.error:
            # We'll need to re-raise
            e_type, e_value, e_tb = sys.exc_info()

            # Make sure the socket is closed
            self.close()

            # Re-raise
            raise e_type, e_value, e_tb
963338
protected function abortCommandExecution()
    {
        $this->server = $this->checkEnv('server', 'ACACHA_FORGE_SERVER');
        $this->domain = $this->checkEnv('domain', 'ACACHA_FORGE_DOMAIN');

        $this->abortIfNoSSHConnection();
    }
1368759
public function disconnect($silent = false) {
        if (!is_resource($this->connection))
            return;

        if (!$silent) {
            $this->writeData('QUIT');
            $response = $this->readResponse();

            $this->parseResponse($response);
            if ($this->responseStatus != 221)
                throw new RuntimeException('QUIT command not accepted: '.$this->responseStatus.' '.$this->response.NL.NL.'SMTP transfer log:'.NL.'------------------'.NL.$this->logBuffer);
        }

        fclose($this->connection);
        $this->connection = null;
    }
433141
void exit(final OtpErlangPid from, final OtpErlangPid to,
            final OtpErlangObject reason) {
        try {
            super.sendExit(from, to, reason);
        } catch (final Exception e) {
        }
    }
387075
def abort(self):
        
        if self.transport:
            self.transport.abort()
        self.event('connection_lost').fire()
28968
def send_exit(cls, sock, payload=b''):
    """"""
    cls.write_chunk(sock, ChunkType.EXIT, payload)
205445
private function sendDisconnect()
    {
        if(!$this->socket || feof($this->socket))
            return;

        $payload = chr(0xe0).chr(0x00);
        fwrite($this->socket, $payload, 2);

        $this->debugMessage("DISCONNECT sent");
    }
499954
public function smtpClose()
    {
        if (null !== $this->smtp) {
            if ($this->smtp->connected()) {
                $this->smtp->quit();
                $this->smtp->close();
            }
        }
    }
611083
def __send_break(self):
        
        if self.port:
            self.logger.debug("sendBreak to device to reboot", extra={'type': '<->'})
            result = self.port.safe_sendBreak()
            time.sleep(1)
            if result:
                self.logger.debug("reset completed", extra={'type': '<->'})
            else:
                self.logger.warning("reset failed", extra={'type': '<->'})
            return result
        return None
153866
def send_packed_command(self, command):
        ""
        if not self._sock:
            self.connect()
        try:
            if isinstance(command, str):
                command = [command]
            for item in command:
                self._sock.sendall(item)
        except socket.timeout:
            self.disconnect()
            raise TimeoutError("Timeout writing to socket")
        except socket.error:
            e = sys.exc_info()[1]
            self.disconnect()
            if len(e.args) == 1:
                errno, errmsg = 'UNKNOWN', e.args[0]
            else:
                errno = e.args[0]
                errmsg = e.args[1]
            raise ConnectionError("Error %s while writing to socket. %s." %
                                  (errno, errmsg))
        except:  # noqa: E722
            self.disconnect()
            raise
1274138
def close_connection_command(opts)
      AuditCookStub.instance.close(opts[:thread_name])
      CommandIO.instance.reply(opts[:conn], 'OK')
    end
1200270
private function disconnect()
    {
        $r = $this->write('QUIT');

        fclose($this->sock);

        $this->sock = null;

        return $r;
    }