0
我已經將我的asmack庫從asmack-issue15.jar
更改爲asmack-android-7.jar
從Flowdalic/asmack項目。一切運行平穩,但我從我的服務器到android智能手機的文件傳輸有問題。轉移的狀態永遠不會完成,因爲它在「進行中」狀態下循環。aSmack XMPP文件傳輸處於「進行中」狀態的循環
註冊的擴展:
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());
}
請告訴我錯在這裏?
我只能一遍又一遍地重複自己。 [沒有XMPP節跡,沒有人能夠告訴你哪裏出了問題。如果你有你的節追蹤,由於XMPP的開放性,你可以找出自己出了什麼問題。](https://github.com/Flowdalic/asmack/wiki/aSmack-XMPP-File-Transfer ) – Flow
嘿,這是一個服務器問題,我啓用了在openfire中的代理文件傳輸,現在一切正常。謝謝 – sbo