我正在为我的 iPhone 聊天应用程序使用 xmpp 框架。我可以通过 xmpp 框架进行文本聊天。
- (void)viewDidLoad {
TURNSocket *turnSocket = [[TURNSocket alloc] initWithStream:[self xmppStream] toJID:jid];
[turnSockets addObject:turnSocket];
[turnSocket startWithDelegate:self delegateQueue:dispatch_get_main_queue()];
[turnSocket release];
}
- (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];
}
但是想在openfire服务器上通过xmpp框架传输文件,建立TurnSocketConnection失败。