我試圖訪問61616在我的iPhone應用程序和SCReachability代碼指示,我有一個有效的網絡,但我超時試圖寫入61616有誰知道:iPhone EDGE/3G網絡端口範圍?有人知道嗎?
A.如果iPhone EDGE/3G網絡端口範圍有限,或者不允許連接到此端口?
B.我如何明確檢查是否可以訪問此端口。這是我的「網絡可達」代碼(借用蘋果的例子),它檢查「foo.bar.com」,但不顯示如何檢查「foo.bar.com:61616」。
任何幫助表示讚賞!
- (BOOL)isDataSourceAvailable{
static BOOL checkNetwork = YES;
BOOL _isDataSourceAvailable = NO;
if (checkNetwork) { // Since checking the reachability of a host can be expensive, cache the result and perform the reachability check once.
checkNetwork = NO;
Boolean success;
const char *host_name = "foo.bar.com";
SCNetworkReachabilityRef reachability = SCNetworkReachabilityCreateWithName(NULL, host_name);
SCNetworkReachabilityFlags flags;
success = SCNetworkReachabilityGetFlags(reachability, &flags);
_isDataSourceAvailable = success && (flags & kSCNetworkFlagsReachable) && !(flags & kSCNetworkFlagsConnectionRequired);
CFRelease(reachability);
}
return _isDataSourceAvailable;
}