OSSNetworking.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. //
  2. // OSSNetworking.h
  3. // oss_ios_sdk
  4. //
  5. // Created by zhouzhuo on 8/16/15.
  6. // Copyright (c) 2015 aliyun.com. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. #import "OSSModel.h"
  10. @class OSSSyncMutableDictionary;
  11. @class OSSNetworkingRequestDelegate;
  12. @class OSSExecutor;
  13. /**
  14. Network parameters
  15. */
  16. @interface OSSNetworkingConfiguration : NSObject
  17. @property (nonatomic, assign) uint32_t maxRetryCount;
  18. @property (nonatomic, assign) uint32_t maxConcurrentRequestCount;
  19. @property (nonatomic, assign) BOOL enableBackgroundTransmitService;
  20. @property (nonatomic, strong) NSString * backgroundSessionIdentifier;
  21. @property (nonatomic, assign) NSTimeInterval timeoutIntervalForRequest;
  22. @property (nonatomic, assign) NSTimeInterval timeoutIntervalForResource;
  23. @property (nonatomic, strong) NSString * proxyHost;
  24. @property (nonatomic, strong) NSNumber * proxyPort;
  25. @end
  26. /**
  27. The network interface which OSSClient uses for network read and write operations.
  28. */
  29. @interface OSSNetworking : NSObject <NSURLSessionDelegate, NSURLSessionDataDelegate>
  30. @property (nonatomic, strong) NSURLSession * session;
  31. @property (nonatomic, assign) BOOL isUsingBackgroundSession;
  32. @property (nonatomic, strong) OSSSyncMutableDictionary * sessionDelagateManager;
  33. @property (nonatomic, strong) OSSNetworkingConfiguration * configuration;
  34. @property (nonatomic, strong) OSSExecutor * taskExecutor;
  35. - (instancetype)initWithConfiguration:(OSSNetworkingConfiguration *)configuration;
  36. - (OSSTask *)sendRequest:(OSSNetworkingRequestDelegate *)request;
  37. @end