如何将文件传输到另一个用户 . 我正在使用xmpp协议进行连接我已尝试下面的代码进行连接 . 但每次连接失败时我都会收到消息 .
[TURNSocket setProxyCandidates:@ [@“testserver-desktop”]];
XMPPJID *jid = [XMPPJID jidWithString:@"256122466@testserver-desktop"];
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.");
}
- (void)turnSocketDidFail:(TURNSocket *)sender {
NSLog(@“TURN连接失败!”);
}
请让我如何在两个用户之间 Build 连接以进行文件传输 .