'Establish the SMB connection to the remote SMB/CIFS server.
You must call this method before attempting any of the file operations with the remote server.
This method will block until the SMB connection has attempted at least one authentication.
:return: A boolean value indicating the result of the authentication atttempt: True if authentication is successful; False, if otherwise.'

def connect(self, ip, port=139, sock_family=socket.AF_INET, timeout=60):

    if self.sock:
        self.sock.close()
    self.auth_result = None
    self.sock = socket.socket(sock_family)
    self.sock.settimeout(timeout)
    self.sock.connect((ip, port))
    self.is_busy = True
    try:
        if (not self.is_direct_tcp):
            self.requestNMBSession()
        else:
            self.onNMBSessionOK()
        while (self.auth_result is None):
            self._pollForNetBIOSPacket(timeout)
    finally:
        self.is_busy = False
    return self.auth_result
