All Projects → TimOliver → Tosmbclient

TimOliver / Tosmbclient

Licence: other
An Objective-C binding around the libDSM SMB client library.

Programming Languages

c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to Tosmbclient

Pscarouselview
A drop-in carousel view. Most of Apps put it in their first screen.
Stars: ✭ 149 (-8.02%)
Mutual labels:  cocoapods
Toroundedtableview
A subclass of UITableView that styles it like Settings.app on iPad
Stars: ✭ 157 (-3.09%)
Mutual labels:  cocoapods
Version
Represent and compare versions via semantic versioning (SemVer) in Swift
Stars: ✭ 160 (-1.23%)
Mutual labels:  cocoapods
Heapinspector For Ios
Find memory issues & leaks in your iOS app without instruments
Stars: ✭ 1,819 (+1022.84%)
Mutual labels:  cocoapods
Apesuperhud
A simple way to display a HUD with a message or progress information in your application.
Stars: ✭ 156 (-3.7%)
Mutual labels:  cocoapods
Trilabelview
A triangle shaped corner label view for iOS written in Swift.
Stars: ✭ 158 (-2.47%)
Mutual labels:  cocoapods
Pclblureffectalert
Swift AlertController with UIVisualeffectview
Stars: ✭ 148 (-8.64%)
Mutual labels:  cocoapods
Campcotcollectionview
Collapse and expand UICollectionView sections with one method call.
Stars: ✭ 161 (-0.62%)
Mutual labels:  cocoapods
Accordionswift
The best way of implement an accordion menu using an UITableView in Swift
Stars: ✭ 156 (-3.7%)
Mutual labels:  cocoapods
Bluetonium
Bluetooth mapping in Swift
Stars: ✭ 159 (-1.85%)
Mutual labels:  cocoapods
Swiftcolorgen
A tool that generate code for Swift projects, designed to improve the maintainability of UIColors
Stars: ✭ 152 (-6.17%)
Mutual labels:  cocoapods
Underlinetextfield
Simple UITextfield Subclass with state
Stars: ✭ 156 (-3.7%)
Mutual labels:  cocoapods
Lcbannerview
A very popular and highly customized banner view! Infinite loop support!
Stars: ✭ 158 (-2.47%)
Mutual labels:  cocoapods
Wobbly
(Animate CSS) animations for iOS. An easy to use library of iOS animations. As easy to use as an easy thing.
Stars: ✭ 150 (-7.41%)
Mutual labels:  cocoapods
Shoppingcartexample
A simple shopping cart example iOS App
Stars: ✭ 160 (-1.23%)
Mutual labels:  cocoapods
Cminputview
💪之前代码是基于UITextView进行的封装,侵入性较强,不方便使用,现使用Category重构代码,支持Cocoapods
Stars: ✭ 149 (-8.02%)
Mutual labels:  cocoapods
Cdmarkdownkit
An extensive Swift framework providing simple and customizable markdown parsing.
Stars: ✭ 158 (-2.47%)
Mutual labels:  cocoapods
Swiftaudio
Audio player for iOS
Stars: ✭ 160 (-1.23%)
Mutual labels:  cocoapods
Kvkcalendar
A most fully customization calendar and timeline library for iOS 📅
Stars: ✭ 160 (-1.23%)
Mutual labels:  cocoapods
Zkudid
Generate and save permanent UDID with IDFV and keychain in iOS device.
Stars: ✭ 159 (-1.85%)
Mutual labels:  cocoapods

TOSMBClient

Beerpay PayPal

TOSMBClient is a small library that serves as a simple SMB (Server Message Block ) client for iOS apps. The library allows connecting to SMB devices, downloading file metadata, and subsequently allows asynchronous downloading of files from an SMB device straight to an iOS device.

It is an Objective-C wrapper around Defective SMb, or libDSM, a low level SMB client library built in C built by some of VideoLabs' developers. A copy of libDSM has been specially cross-compiled for iOS device architectures and embedded in this library, so this project has no external dependencies.

Features

  • Connects to (MOST) SMB devices over local network.
  • Concurrently download files from SMB devices to your iOS device.
  • Allows basic user authentication, with automatic deferral to 'guest' where possible.
  • Simplified, asynchronous API for accessing file metadata on devices.
  • Uses iOS multitasking to ensure downloads continue even if the app is suspended.

Examples

Create a new Session

#import "TOSMBClient.h"

TOSMBSession *session = [[TOSMBSession alloc] initWithHostName:@"Tims-NAS" ipAddress:@"192.168.1.3"];
[session setLoginCredentialsWithUserName:@"wagstaff" password:@"swordfish"];

Ideally, it is best to supply both the host name and IP address when creating a new session object. However, if you only initially know one of these values, TOSMBSession will perform a lookup via NetBIOS to try and resolve the other value.

Request a List of Files from the SMB Device

// Asynchronous Request
[session requestContentsOfDirectoryAtFilePath:@"/"
    success:^(NSArray *files){ 
      NSLog(@"SMB Client Files: %@", error.localizedDescription);
    }
    error:^(NSError *error) {
        NSLog(@"SMB Client Error: %@", error.localizedDescription);
    }];
    
// Synchronous Request
NSArray *files = [session requestContentsOfDirectoryAtFilePath:@"/" error:nil];

All request methods have a synchronous and an asynchronous implementation. Both return an NSArray of TOSMBSessionFile objects that provide metadata on each file entry discovered.

Downloading a File from an SMB Device

TOSMBSessionDownloadTask *downloadTask = [session downloadTaskForFileAtPath:@"/Comics/Issue-1.cbz"
      destinationPath:nil //Default is 'Documents' directory
      progressHandler:^(uint64_t totalBytesWritten, uint64_t totalBytesExpected) { NSLog(@"%f", (CGFloat)totalBytesWritten / (CGFloat) totalBytesExpected);
      completionHandler:^(NSString *filePath) { NSLog(@"File was downloaded to %@!", filePath); }
      failHandler:^(NSError *error) { NSLog(@"Error: %@", error.localizedDescription); }];

[downloadTask resume];

Download tasks are handled similarily to their counterparts in NSURLSession. They may paused or canceled at anytime (Both however reset the connection to ensure nothing hangs), and they additionally implement the UIApplication backgrounding system to ensure downloads can continue, even if the user clicks the Home button.

Technical Requirements

iOS 7.0 or above.

License

Depending on which license you are using for libDSM, TOSMBClient is available in multiple licenses.

For the LGPL v2.1 licensed version of libDSM, TOSMBClient is also available under the same license. For the commercially licensed version of Defective SMb, TOSMBClient is available under the MIT license. analytics

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].