aliyun-oss-react-native

OSSNetworking.h 1.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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 * dataSession;
  31. @property (nonatomic, strong) NSURLSession * uploadFileSession;
  32. @property (nonatomic, assign) BOOL isUsingBackgroundSession;
  33. @property (nonatomic, strong) OSSSyncMutableDictionary * sessionDelagateManager;
  34. @property (nonatomic, strong) OSSNetworkingConfiguration * configuration;
  35. @property (nonatomic, strong) OSSExecutor * taskExecutor;
  36. - (instancetype)initWithConfiguration:(OSSNetworkingConfiguration *)configuration;
  37. - (OSSTask *)sendRequest:(OSSNetworkingRequestDelegate *)request;
  38. @end