This commit is contained in:
robin
2026-03-05 02:52:45 +08:00
parent 49776c3d0a
commit a10f3f3740
8 changed files with 171 additions and 351 deletions

View File

@@ -1,9 +1,7 @@
//
//
// DemoResolveModel.m
// NewHttpDNSTestDemo
//
// @author Created by Claude Code on 2025-10-05
//
#import "DemoResolveModel.h"
@@ -11,32 +9,15 @@
- (instancetype)init {
if (self = [super init]) {
_host = @"www.new.com";
_ipType = HttpdnsQueryIPTypeBoth;
_host = @"demodemo.cloudxdr.com";
_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