我正在实施聊天应用程序。 我想传输一个文件,但我一直在TURN连接失败!我使用以下代码:
XMPPJID *jid = [XMPPJID jidWithString:@"user@krishanyadav.local/resourceID"] ;
TURNSocket *turnSocket = [[TURNSocket alloc] initWithStream:[self xmppStream] toJID:jid];
[turnSockets addObject:turnSocket];
[TURNSocket setProxyCandidates:@[JABBER_DOMAIN_NAME, JABBER_DOMAIN_NAME]];
[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:sende
}
如何使用iOS xmpp jabber2服务器传输文件 注意:我能够从服务器将文件从Audim发送到iMessage messenger(相互之间)。