File transfer from plugin problem

I have been working on establishing file transfers to and from an Openfire plugin. To do this I have the plugin create a contact that has a fileTransferListener. File transfers to a client from the plugin (plugin client) work just fine. Transfers from a client to the plugin (plugin client) terminate with the following error: The remote user did not respond or the connection timed out. I need help to understand why.

I am testing the connections on a single computer, however, this needs to also work in a server environment with remote connections.

I mapped out the packets going back and forth for this transaction.

Initial file transfer request sent by the server (plugin client):

<si xmlns="http://jabber.org/protocol/si" id=“jsi_6494784254748412498” profile="http://jabber.org/protocol/si/profile/file-transfer">

<file xmlns="http://jabber.org/protocol/si/profile/file-transfer" name=“model.jar” size=“7486597”>

Requested file

](http://jabber.org/protocol/feature-neg">)

http://jabber.org/protocol/bytestreams

http://jabber.org/protocol/ibb</value?

Response from the client:

](http://jabber.org/protocol/si">)

](http://jabber.org/protocol/feature-neg">)

http://jabber.org/protocol/bytestreams

http://jabber.org/protocol/ibb

That is the end of the packets. The transfer times out with the aforementioned error. Again, any input here is appreciated and if I have not included useful information please let me know.

Thank you.

Ok. I figured it out. Not that it makes much sense why it works this way and not the other, however, I will describe the change and if anyone has a better explanation for this I would appreciate it.

The way the file transfer from the server to the client was setup, the client would send the initial message to the plugin. This would create a database entry and then tell the plugin established file transfer client to send the requested file to the requesting client. It would perform this all in one method call chain initiating from the packet listener. The result was the negotiating stream loop that would time out.

The change:

I hacked out the file transfer component and had the plugin return a confirmation receipt to the requesting client after creating the database entry. The requesting client would take the receipt message and then submit and available presence message to the server that would propagate in the file transfer client’s roster presence listener. This now goes and looks at the database to check for a transfer request and initiates the transfer if one exists. For some reason, this method works and the previous one does not.

I hope that this helps someone else out there. Even better, I hope someone can shed some light on why this change works.