Iphone 转换套接字连接失败
我总是让转弯连接失败。这是我正在使用的代码Iphone 转换套接字连接失败,iphone,openfire,xmppframework,Iphone,Openfire,Xmppframework,我总是让转弯连接失败。这是我正在使用的代码 - (void)viewDidLoad { XMPPJID *jid = [XMPPJID jidWithString:chatWithUser resource:@"Smack"]; [TURNSocket setProxyCandidates:[NSArray arrayWithObjects:chatWithUser, nil]]; TURNSocket *turnSocket = [[TURNSocket alloc] ini
- (void)viewDidLoad {
XMPPJID *jid = [XMPPJID jidWithString:chatWithUser resource:@"Smack"];
[TURNSocket setProxyCandidates:[NSArray arrayWithObjects:chatWithUser, nil]];
TURNSocket *turnSocket = [[TURNSocket alloc] initWithStream:[self xmppStream] toJID:jid];
[turnSockets addObject:turnSocket];
[turnSocket startWithDelegate:self delegateQueue:dispatch_get_main_queue()];
}
- (void)turnSocket:(TURNSocket *)sender didSucceed:(GCDAsyncSocket *)socket {
NSLog(@"TURN Connection succeeded!");
NSLog(@"You now have a socket that you can use to send/receive data to/from the other person.");
[turnSockets removeObject:sender];
}
- (void)turnSocketDidFail:(TURNSocket *)sender {
NSLog(@"TURN Connection failed!");
[turnSockets removeObject:sender];
}
同样的事情也发生在我身上。你的问题解决了吗?