[jdev] File xfer gone wrong?
anthonypaulo at gmail.com
Wed Mar 9 16:39:13 CST 2005
I posted a message on the exodus newsgroup a while back but I think
it's dead as I haven't seen any activity in weeks. Maybe someone has
been thought this before or can spot the obvious and point me in the
right direction, so I'm reposting most of it here.
=== repost from exodus newsgroup ===
I've written a simple java applet that implements the Jabber protocol in very
much the same way yahoo chat works. Right now things are going smoothly, I can
log in, do rostering, chatting, and bytestream file transfers. I have been
testing so far against the PSI client, and I am able to transfer files back and
forth no problem. However, I seem to be having a problem with the Exodus client.
I am able to receive a file from an Exodous client just fine (though I had to
use the latest development build 0.9.0.39; 0.9.0.0 resulted in a corrupted
file), but for some reason I can't seem to send a file to Exodus, it gives me
the error "Exodus was unable to connect to any file transfer proxies or the
sender." This is what happens :
1) I do the usual stream initiation stuff
2) I create a server socket on host:port
3) I send the iq containing the streamhost stanza with the host:port
4) I accept the connection on the serversocket
At this point the Exodus client is sending me a SOCKS5 version
identifier/method selection message, stating that it
supports "no authentication"
5) I send 2 bytes in response, the first byte being the version (5) and the
second being "no authentication" (0).
At this point the Exodus client is sending me a socks5 request message
host = SHA1 hash
So far so good!
6) hash matches great, so I send the Exodus client a reply message with
status = 0 meaning we're good to go
It is at this point that I believe I have nothing left to do but wait for an
iq response from the exodus client, but instead it immediately pops up an
error message stating that it was unable to connect. How can that be when
everything seemed to be going so well?? Is Exodus expecting something else?
Or maybe I should be setting the other fields in my reply besides setting the
status field to 0?? I tried filling in the reply message fields with :
version : 5
reply (status) : 0
reserved : 0
type = 3
addr = host
port = port
and this doesn't work either. What am I doing wrong?? What's weird is that I
can transfer files both ways against a PSI client, and PSI and Exodus work
fine against each other as well, but it's only when I try to send a file to
Exodus that I have this problem. Heeeeeeeeelp!!
Thank you for your time!! :)
More information about the JDev