feat: sync httpdns sdk/platform updates without large binaries

This commit is contained in:
robin
2026-03-04 17:59:14 +08:00
parent 853897a6f8
commit 532891fad0
700 changed files with 6096 additions and 2712 deletions

View File

@@ -0,0 +1,48 @@
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@class HttpdnsNWHTTPClient;
@interface HttpdnsNWReusableConnection : NSObject
@property (nonatomic, strong) NSDate *lastUsedDate;
@property (nonatomic, assign) BOOL inUse;
@property (nonatomic, assign, getter=isInvalidated, readonly) BOOL invalidated;
- (instancetype)initWithClient:(HttpdnsNWHTTPClient *)client
host:(NSString *)host
port:(NSString *)port
useTLS:(BOOL)useTLS NS_DESIGNATED_INITIALIZER;
- (instancetype)init NS_UNAVAILABLE;
- (BOOL)openWithTimeout:(NSTimeInterval)timeout error:(NSError **)error;
- (nullable NSData *)sendRequestData:(NSData *)requestData
timeout:(NSTimeInterval)timeout
remoteConnectionClosed:(BOOL *)remoteConnectionClosed
error:(NSError **)error;
- (BOOL)isViable;
- (void)invalidate;
@end
#if DEBUG
// 测试专用:连接状态检查与操作
@interface HttpdnsNWReusableConnection (DebugInspection)
// 状态检查(这些属性已在主接口暴露,这里仅为文档明确)
// @property lastUsedDate - 可读<E58FAF><E8AFBB>?
// @property inUse - 可读<E58FAF><E8AFBB>?
// @property invalidated - 只读
// 测试辅助方法
- (void)debugSetLastUsedDate:(nullable NSDate *)date;
- (void)debugSetInUse:(BOOL)inUse;
- (void)debugInvalidate;
@end
#endif
NS_ASSUME_NONNULL_END