I’m using smack (3.1) in a java application run on many machines throughout our network. Each machine (behind the scenese) connects to an open fire server anonymously and joins a pre-defined chat room. All communication is sent either through the chat room or by creating direct chat with a user based on their chatroom JID. Everything works great until I try to transfer files.
I can transfer a file perfectly when sending to an authenticated user (user@server/smack).
There are problems when I try to send a file to a user in a chat room (firstname.lastname@example.org/nickname).
I’ve debugged this a bit. I believe the issue to be on the sending end. Here’s what I’ve found…
In the method OutgoingFileTransfer.sendFile(File, String), it tries to get an outputStream by calling negotiateStream() (line 214). This is returning null.
The negotiateStream() method returns null because when it eventually gets to Socks5TransferNegotiator.initBytestreamSocket(String, String, String), calling createDigest() on line 299/300 returns a String that does not match any key in the socket hashmap. I know this because in the waitForUsedHostResponse(…) method, calling proxy.getSocket() on line 355 does not return a socket.
So, because of all the above, the sender class is never able to communicate back to the receiving class that it’s ready to send a file.
Ok, any ideas on a work around? Is this something that can be fixed any time soon?
Thanks all for a great API. Works well for the most part!