sdk final

This commit is contained in:
robin
2026-03-05 16:53:59 +08:00
parent a10f3f3740
commit 491ade1bc3
44 changed files with 1595 additions and 960 deletions

View File

@@ -1,7 +1,9 @@
//
//
// DemoResolveModel.m
// NewHttpDNSTestDemo
//
// @author Created by Claude Code on 2025-10-05
//
#import "DemoResolveModel.h"
@@ -9,15 +11,32 @@
- (instancetype)init {
if (self = [super init]) {
_host = @"demodemo.cloudxdr.com";
_host = @"demo.cloudxdr.com";
_ipType = HttpdnsQueryIPTypeBoth;
_ipv4s = @[];
_ipv6s = @[];
_elapsedMs = 0;
_ttlV4 = 0;
_ttlV6 = 0;
_error = nil;
}
return self;
}
- (void)updateWithResult:(HttpdnsResult *)result startTimeMs:(NSTimeInterval)startMs {
NSTimeInterval now = [[NSDate date] timeIntervalSince1970] * 1000.0;
_elapsedMs = MAX(0, now - startMs);
if (result != nil) {
_ipv4s = result.ips ?: @[];
_ipv6s = result.ipv6s ?: @[];
_ttlV4 = result.ttl;
_ttlV6 = result.v6ttl;
} else {
_ipv4s = @[];
_ipv6s = @[];
_ttlV4 = 0;
_ttlV6 = 0;
}
}
@end