简体   繁体   English

Ejabberd + iOS XMPPFramework ..没有连接到服务器

[英]Ejabberd + iOS XMPPFramework.. not connecting to server

I am attempting to connect to an ejabberd server hosted here: 我正在尝试连接到此处托管的ejabberd服务器:

198.199.106.154:5280 198.199.106.154:5280

The issue is that this block of code is not calling iOS XMPP Framework's delegate: - (void)xmppStreamDidConnect:(XMPPStream *)sender 问题是这段代码没有调用iOS XMPP Framework的委托: - (void)xmppStreamDidConnect:(XMPPStream *)sender

I am confident that my server has made a connection because the following log appears on the server after the code has executed: 我确信我的服务器已建立连接,因为代码执行后服务器上会出现以下日志: SERVERLOG

- (void)setupStream {

xmppStream = [[XMPPStream alloc] init];
xmppStream.hostName = @"198.199.106.154";
xmppStream.hostPort = 5280;
NSString * jabberID = [[NSString alloc] initWithFormat:@"admin@%@", @"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()];

}

I am absolutely lost folks! 我绝对是穷人! Any guidance would be immensely helpful 任何指导都会非常有帮助

XMPPFramework使用标准的XMPP TCP连接(由ejabberd_c2s模块通常在5222端口上处理),但是您正在尝试连接到http-bind模块,这在XMPPFramework中没有实现。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM