我正在使用(或尝试......)AsyncSocket 连接到服务器,但即使服务器未运行,它也始终连接......我正在使用 SDK 3.1.2。以前有人遇到过这个问题吗?
#import "mluPresenterAppDelegate.h"
#import "AsyncSocket.h"
@implementation mluPresenterAppDelegate
@synthesize window;
#pragma mark -
#pragma mark Application lifecycle
- (void)applicationDidFinishLaunching:(UIApplication *)application {
AsyncSocket *assClient = [[AsyncSocket alloc] initWithDelegate:self];
NSError *err = nil;
if (![assClient connectToHost:@"127.0.0.1" onPort:7777 error:&err]) {
NSLog(@"%@ %@", [err code], [err localizedDescription]);
} else {
NSLog(@"Conectou!");
}
[window makeKeyAndVisible];
}
结果总是2010-02-22 22:54:26.922 mluPresenter[2083:207] Conectou!即使我将端口更改为 1 或更改为超出范围的端口...
提前致谢。