Example #1
0
    def close(self, msg='quit'):
        """Closes the connection with the server by sending 'quit'
        to cleanly close the connection."""

        if msg:
            try:
                self.sendCmd('quit', readresp=0)
            # it's possible that we are already disconnected
            except Sockets.SocketError:
                pass

        ClientServerSocket.close(self)
Example #2
0
    def close(self, msg='quit'):
        """Closes the connection with the server by sending 'quit'
        to cleanly close the connection."""

        if msg:
            try:
                self.sendCmd('quit', readresp=0)
            # it's possible that we are already disconnected
            except Sockets.SocketError:
                pass

        ClientServerSocket.close(self)
Example #3
0
    def close(self, msg='quit'):
        """Close the connection with server."""

        # if this is a keepalive connection then make sure we tell the
        # server that we are done.
        if self.keepalive and msg:
            try:
                self.send({'close': msg}, timeout=self.timeout)
            # it's possible that we are already disconnected
            except Sockets.SocketError:
                pass

        ClientServerSocket.close(self)
Example #4
0
    def close(self, msg='quit'):
        """Close the connection with server."""

        # if this is a keepalive connection then make sure we tell the
        # server that we are done.
        if self.keepalive and msg:
            try:
                self.send({'close': msg}, timeout=self.timeout)
            # it's possible that we are already disconnected
            except Sockets.SocketError:
                pass

        ClientServerSocket.close(self)