Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use 'attemptConnection' #65

Open
anonymouz4 opened this issue Jun 30, 2018 · 0 comments
Open

How to use 'attemptConnection' #65

anonymouz4 opened this issue Jun 30, 2018 · 0 comments

Comments

@anonymouz4
Copy link

anonymouz4 commented Jun 30, 2018

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)
        }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant