Skip to content

How to use 'attemptConnection' #65

@anonymouz4

Description

@anonymouz4

So I've been stuck with this for a while now and I still can't figure it out how to use.

From what I understood here, it should be able to call it without argument like below but Xcode requires to use a session Pointer
session?.attemptConnection() –> xcode doesn't allow this

–> Xcode says, Opaquepointer is required
session?.attemptConnection(withSessionPointer: <#T##OpaquePointer!#>)

So I've tried every possible way of using a Opaquepointer Pointer but it always crashes.

Any Ideas or has anybody ever done this successful?

Other Tries:
If LoginData is specified -> instant crash
If Not -> Prints "Login Failed" and crashes

session = TOSMBSession(hostName: host, ipAddress: "192.168.0.21")
        
        //session?.setLoginCredentialsWithUserName("User", password: "!0z!g")
        
        if let test = session?.attemptConnection(withSessionPointer: OpaquePointer(UnsafeMutableRawPointer(Unmanaged.passUnretained(self).toOpaque()))) {
            print(test.localizedDescription)
        }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions