TOSMBClient
TOSMBClient copied to clipboard
Add TOSMBSession Timeout variable
Hardware / Software
Which version of the library were you using? Custom Library with recompiled .a for TVOS
Which version of iOS are you running? TVOS 10.2
What model of iOS device were you testing on? AppleTV 2
If using CocoaPods, which version of CocoaPods are you on? 1.2.0
Goals
What is the outcome result you want to achieve with this library?
The default timeout is too long and it would be nice if we could modify it. For exemple my app use a completion block when the error block is called on function requestContentsOfDirectory(atFilePath path: String!, success successHandler: (([Any]?) -> Swift.Void)!, error errorHandler: ((Error?) -> Swift.Void)!)
The problem is the error block is called so far after the function call and i can't use the synchronous version because the app can't be stuck such long time.
Might be amazing if you could implement this feature.
Hi @yamakhalah! Thanks for the issue!
Yeah. I agree. When I was testing this library, I mistyped the URL to my NAS several times and the timeout delay was really annoying.
Unfortunately, this is a libdsm level issue. I tried playing with the libdsm source code last year to try and introduce a connection timeout limit, but for the life of me, I couldn't get it working. I'm sadly still very new to the general concept of sockets, so I'm not sure how to properly configure them.
If anyone else wants to give it a try and submit a PR, this feature would be very much appreciated. :)
Hi,
Thanks for the quick reply.
As i can see, libdsm send some informations when you try to connect or receive files, and you print it.
Exemple:
netbios_ns_inverse: : No such file or directory netbios_session_new, open_socket: : Operation timed out
Could be possible for you to add a delegate which send every status change with an Enumerate in order to receive clear informations of whats going on.
TOSMBClient connexion could be stopped quickly with this kind of implementation.