views:

417

answers:

4

Has anyone had any experience using Adobe Air to create BitTorrent application?

Is there presently any reference on this?

Please provide as much information as possible.

+1  A: 

as far as I know, torrent uses µTP, which is based on UDP ... UDP is not accessible through the AIR API ... you may want to embed a small Java applet (within a HTMLLoader, which is off the display list) ... signed Java applets can bind ports and do UDP ... so you'd basically let the Java applet do the networking, and bind a TCP port, through which the AIR runtime can communicate with the applet ... there are probably many Java torrenting libs out there ...

it's a bit questionable, whether it makes sense to use AIR at all, and not just have a pure Java solution, but I guess that's up to you ... ;)

greetz

back2dos

back2dos
µTP is a recent extension. The regular BitTorrent protocol uses TCP.
bobince
so, is just use adodbe air, tcp possible create torrent client? any library/app that already using this way?
cometta
@bobince: ah, ok, thanks ... didn't know that ... UDP seemed to make more sense for p2p to me, since it allows NAT punchthroughs ... are there any decent specs around?@cometta: none that i know of ...
back2dos
A: 

AIR can read/write arbitrary binary data over TCP sockets, so in theory an AIR app can implement any protocol you like. The main limitation, though, is that AIR cannot listen for incoming connections, it can only make outgoing requests.

I don't know anything about the BT protocol, but commenter Michael Madsen says that BT clients can still work with this limitation, the same way they typically function behind routers or firewalls. If that's the case, then I can't see any reason why one couldn't construct an AIR BitTorrent client, but I don't know of any work that's already been done in that direction.

fenomas
Well, it's certainly possible to not require incoming connections - essentially, that's what's happening if you're behind a router without the appropriate port forwarded. As far as I'm aware, you'll usually see some slowdown in download and upload speeds, mostly because there are fewer peers you can communicate with (only your own local connections).
Michael Madsen
Hm, then it ought to be possible in theory then. I'll update my answer. PS, I'm a big fan of your movies. ;)
fenomas
A: 

that isn't a problem for windows u use uToerrent they have a API for a AIR Client...

For Mac and Linux can u use Transmission... For transmission here the client: http://github.com/lennart/Transmissionair

LittleBuddha
+1  A: 

back2dos is incorrect... check out the DatagramSocket class in the ActionScript 3 reference http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/DatagramSocket.html

Alex
Back2dos was not incorrect at the time of answering, as *DatagramSocket* came with the release of AIR 2.0 which was not released yet. But good job for keeping answers up-to-date
TandemAdam