(self, code=1000, reason='')
Initiate the closing handshake with the server.
Initiate the closing handshake with the server.
Initiate the closing handshake with the server .
def close(self, code=1000, reason=''):
        """
        Initiate the closing handshake with the server.
        """
        if not self.client_terminated:
            self.client_terminated = True
            self.sock.sendall(self.stream.close(code=code, reason=reason).single(mask=True))
def close ( self , code = 1000 , reason = '' ) : if not self . client_terminated : self . client_terminated = True self . sock . sendall ( self . stream . close ( code = code , reason = reason ) . single ( mask = True ) )