1
我試圖連接到在這裏舉辦的ejabberd服務器:Ejabberd + iOS的XMPPFramework ..沒有連接到服務器
198.199.106.154:5280
的問題是,這個代碼塊未調用的iOS XMPP架構的委託: - (空)xmppStreamDidConnect:
我相信,我的服務器已經做了一個連接,因爲下面的日誌中的代碼已被執行之後在服務器上出現(XMPPStream *)發件人:
- (void)setupStream {
xmppStream = [[XMPPStream alloc] init];
xmppStream.hostName = @"198.199.106.154";
xmppStream.hostPort = 5280;
NSString * jabberID = [[NSString alloc] initWithFormat:@"[email protected]%@", @"localhost"];
[xmppStream setMyJID:[XMPPJID jidWithString:jabberID]];
NSError *error2 = nil;
[xmppStream connectWithTimeout:10.0f error:&error2];
NSLog(@"here is the connect error %@", [error2 localizedDescription]); //NO ERROR IS CALLED!
dispatch_async(dispatch_get_main_queue(), ^{
[self authWithServer];
NSTimer *timer = [NSTimer scheduledTimerWithTimeInterval:2.0 target:self selector:@selector(authWithServer) userInfo:nil repeats:YES];
//I GET THE FOLLOWING MESSAGE:: "Please wait until the stream is connected"
});
[xmppStream addDelegate:self delegateQueue:dispatch_get_main_queue()];
}
我絕對失去了人!任何指導都將非常有幫助
你解決了這個問題@ user330739 – 2017-01-11 11:31:12