开发者

Connection problem in smack api

开发者 https://www.devze.com 2023-03-17 03:26 出处:网络
I am using smack api for file transfer, there am using connetion ConnectionConfiguration connConfig = new ConnectionConfiguration(

I am using smack api for file transfer, there am using connetion

ConnectionConfiguration connConfig = new ConnectionConfiguration(
            "198.162.1.24",5222);

but i know that port 7777 for filetransfer 开发者_如何转开发,when I try to connect with that, my android app becomes force closed because of not connecting to the server.

how do I transfer the file ..

thanks in advance.


first make sure you are not using the native smack jar you need the ported or the patched one (asmack) to because native smack wont work n android

then try these configurations

   SmackConfiguration.setPacketReplyTimeout(15000);
   ConnectionConfiguration connectionConfig = new ConnectionConfiguration(host, port);
   connectionConfig.setRosterLoadedAtLogin(true);
   connectionConfig.setSendPresence(true);
   connectionConfig.setSASLAuthenticationEnabled(false);
   connectionConfig.setReconnectionAllowed(true);
   connection = new XMPPConnection(connectionConfig);
0

精彩评论

暂无评论...
验证码 换一张
取 消