0

我已将我的 asmack 库从Flowdalic /asmack项目更改asmack-issue15.jar为。一切运行顺利,但从服务器到安卓智能手机的文件传输出现问题。传输的状态永远不会完成,因为它在“进行中”状态下循环。asmack-android-7.jar

注册的扩展:

providerM.addIQProvider("si", "http://jabber.org/protocol/si", new StreamInitiationProvider());
providerM.addIQProvider("query", "http://jabber.org/protocol/bytestreams", new BytestreamsProvider());
providerM.addIQProvider("open", "http://jabber.org/protocol/ibb", new OpenIQProvider());
providerM.addIQProvider("close", "http://jabber.org/protocol/ibb", new CloseIQProvider());
providerM.addExtensionProvider("data", "http://jabber.org/protocol/ibb", new DataPacketProvider());

接收文件的代码:

File f = new File(PATH_SDCARD + "/tmp/" + request.getFileName());
IncomingFileTransfer transfer = request.accept();
transfer.recieveFile(f);
int cnt = 0;

while(!transfer.isDone() && cnt < 20) {
   cnt++;
   Log.i(LOG, "STATUS: " + transfer.getStatus().toString());
   Log.i(LOG, "SIZE: " + f.length());
   Log.i(LOG, "PROGRESS: " + transfer.getProgress());
   Thread.sleep(1000);
}
if (transfer.getError() != null) {
   Log.i(LOG, "ERROR: " + transfer.getError());
}
if (transfer.getException() != null) {
   Log.i(LOG, "EXCEPTION: " + transfer.getException());
}

这里有什么问题?

4

1 回答 1

0

这是一个服务器问题。我在 openfire 中启用了文件传输代理,现在一切正常。

于 2012-09-27T20:22:00.800 回答