Could not establish socket with any provided host

允我心安 提交于 2019-12-05 09:03:35
Lakhan Sharma

I got the solution.The problem is with smack sdk.

Smack have some bugs in file transfer implementation: in my case initiator offered bytestreams and ibb methods, responder accept both (which is wrong) methods.

(Reference: answer by @vitalyster here Getting ExecutionException on receiving file using asmack in Android )

It should accept only one. So while creating FileNegotiator, i offered only one stream as:

FileTransferNegotiator fileTransferNegotiator = FileTransferNegotiator.getInstanceFor(xmppTcpConnection);
FileTransferNegotiator.IBB_ONLY = true; 

Now files transfer is working fine.

Thanks everyone.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!