【问题标题】:Ejabberd + iOS XMPPFramework.. not connecting to serverEjabberd + iOS XMPPFramework .. 未连接到服务器
【发布时间】:2015-05-03 07:11:15
【问题描述】:

我正在尝试连接到这里托管的 ejabberd 服务器:

198.199.106.154:5280

问题是这段代码没有调用 iOS XMPP 框架的委托: - (void)xmppStreamDidConnect:(XMPPStream *)sender

我确信我的服务器已建立连接,因为在代码执行后服务器上会出现以下日志:

- (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()];

}

我完全迷路了!任何指导都会非常有帮助

【问题讨论】:

  • 你解决了这个问题@user330739

标签: ios xmpp ejabberd xmppframework


【解决方案1】:

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

【讨论】:

    猜你喜欢
    • 2015-01-01
    • 1970-01-01
    • 2014-09-09
    • 2023-03-05
    • 2017-12-25
    • 2012-04-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多