洛阳学员端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
1.5 KiB

8 months ago
  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