Not logged in. · Lost password · Register
Forum: agsXMPP SDK Support RSS
Avatar
nanodeath #1
Member since Mar 2007 · 3 posts
Group memberships: Members
Show profile · Link to this post
Subject: Simple File Transfer
Hi all.  I just started using this service today and have managed to establish communications (despite a lack of documentation) between a console app and Exodus to simulate the beginning of a crude chat bot app.  One thing I haven't figured out yet is how does one handle file transfer?  I'm just looking for something really simple, like

FileInfo fi = new FileInfo("C:\\AHDL71Setup.log");
agsFile f = new agsFile("C:\\AHDL71Setup.log", fi.Length);
xmpp.Send(f);

simple.  Obviously that doesn't work, but it'd be nice if it did.  Can anyone offer advice, resources, or a code snippet?  Thanks.
Avatar
Jabberer #2
Member since Feb 2006 · 249 posts
Group memberships: Members
Show profile · Link to this post
Did you look at the MiniClient example code? There a complete file transfer example.
There different ways in XMPP to transfer files. The MiniClient example is using SOCKS5 Bytestreams which is currently the standard file transfer in XMPP.

Use also the forums search, there are many threads about file transfer.
Software Developer
AG-Software
Avatar
nanodeath #3
Member since Mar 2007 · 3 posts
Group memberships: Members
Show profile · Link to this post
I actually did look at the source code but I couldn't really decipher it, and most of the threads I found were asking how to do some particular thing with file transfers, not how to get the simplest possible one to work.  I'll try looking at the source code again.
Avatar
Alex #4
Member since Feb 2003 · 4245 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Hello,

ya the file transfer isn't that easy. But the solution in the MiniClient works well for most of our customers/users.
You can just copy&paste the code.
But of course it's always better to know whats goin on in the code in detail ;-)

Alex
Alexander Gnauck
AG-Software
Avatar
nanodeath #5
Member since Mar 2007 · 3 posts
Group memberships: Members
Show profile · Link to this post
I did try going through piece by piece, and discovered that it looks like you need a proxy for it to work...a SOCKS5 proxy from the looks of it (and from what Jabber said).  So I installed a free proxy, but haven't yet finished migrating all the code over from the MiniClient (apparently).  It sounds like there are other ways to do file transfers...can anyone elaborate on these, or are they even more complicated than the MiniClient SOCKS5 proxy way?
Avatar
Jabberer #6
Member since Feb 2006 · 249 posts
Group memberships: Members
Show profile · Link to this post
It is trying to establish a peer to peer connection between both clients.

This is possible if:
  • Both clients are in the same WAN
  • Both clients are on the Internet but at least one of them knows its public IP address and the firewall allows the inbound connection.

In many cases where people are behind NAT or restrictive firewalls it's not possible to setup the peer to peer connection. And in this case the SOCKS5 Proxy in the middle is used to proxy the transfer.

A normal SOCKS5 Proxy does not work, because the Proxy also communicates with the XMPP server. Many XMPP servers ship with a build in SOCKS5 server (eg. wildfire/openfire). For the others that don't have a build in proxy you can use Proxy65 [1].

Other protocols for file transfers are:
  • And there is also the Jingle File Transfer which the XSF is currently developing. But this one is very complicated and relies on complex protocols like ICE and TURN.

[1] http://jabberstudio.org/projects/proxy65/project/view.php
Software Developer
AG-Software
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Forum: agsXMPP SDK Support RSS