Bug 108930 - please support UPnP in KTorrent
Summary: please support UPnP in KTorrent
Status: RESOLVED FIXED
Alias: None
Product: ktorrent
Classification: Applications
Component: general (other bugs)
Version First Reported In: unspecified
Platform: unspecified Linux
: NOR wishlist
Target Milestone: ---
Assignee: Joris Guisson
URL:
Keywords:
: 110763 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-07-11 17:35 UTC by Alexander van Loon
Modified: 2005-11-14 20:25 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander van Loon 2005-07-11 17:35:22 UTC
Version:           1.0 RC2 (using KDE KDE 3.4.1)
Installed from:    Unlisted Binary Package
OS:                Linux

There are a lot of people - including me - who have routers, so they need to forward ports if they want to use KTorrent. Forwarding ports is difficult for some people, and inconvenient for everyone. If Universal Plug-and-Play (UPnP) would be implemented in KTorrent (most routers nowadays support it), it wouldn't be necessary for the user to forward the ports, but KTorrent could take care of it.

http://en.wikipedia.org/wiki/Upnp

Another bittorrent client which has UPnP support implemented is Bitcomet, unfortunately only available for the Windows platform, but it's my favorite Windows BT client.

http://www.bitcomet.com/
http://www.bitcomet.com/doc/faq.htm#UPnP

This has also been suggested for the development of KGet's bittorrent capabilities.

http://bugs.kde.org/show_bug.cgi?id=57591

Unfortunately there hasn't been any development on KGet for weeks.
Comment 1 Joris Guisson 2005-07-11 18:52:09 UTC
I don't have a router, so this could be difficult. 



Comment 2 Thiago Macieira 2005-07-12 03:00:13 UTC
Joris: are you using the socket classes in kdelibs/kdecore/network (the KNetwork classes)?
Comment 3 Joris Guisson 2005-07-12 11:04:32 UTC
Nope, QSocket. Do these classes support UPnP ?
Comment 4 Thiago Macieira 2005-07-12 12:53:47 UTC
No, and they never will. If you use KNetwork, you could assign this bug to me, since UPnP support is part of my to-do list.

By the way, QSocket is forbidden to KDE applications. You have to use KNetwork.
Comment 5 Joris Guisson 2005-07-12 17:56:03 UTC
When I looked at KNetwork, the documentation was not very clear, the service parameter (for example in the constructor of KStreamSocket) wasn't well explained.

From the examples I can now make out that I can just fill in the port (converted to a string). That wasn't very clear back then. So I just went for QSocket. You should really add some more documentation (Just say service can be a port number or one of the following strings, followed by a list of strings)

I'll switch to KNetwork.
Comment 6 Joris Guisson 2005-07-12 18:07:10 UTC
As for assigning this to you, will your implementation require no changes (apart from the KNetwork one) for ktorrent ?
Comment 7 Thiago Macieira 2005-07-12 20:48:35 UTC
My idea is that you won't require any special code on the app side. Everything should be handled by the library.

Service is the port name (i.e., "http" or "80").
Comment 8 Joris Guisson 2005-07-13 11:48:36 UTC
You get the bug

Another question, with KStreamSocket can the node parameter (the hostname) be an IP address ?

Is this valid :
KStreamSocket("123.123.123.123","6666")
Comment 9 Thiago Macieira 2005-07-13 12:45:51 UTC
Joris Guisson wrote:
>Another question, with KStreamSocket can the node parameter (the
> hostname) be an IP address ?
>
>Is this valid :
>KStreamSocket("123.123.123.123","6666")


Yes.
Comment 10 Ivor Hewitt 2005-09-12 11:09:07 UTC
Thiago,
Hi, I just stumbled upon this bug. What's your current status on upnp?
I ask because I have a primative (it purely supports hunting for routers and making nat holes) UPnP class working that I was going to incorporate into konversation for dcc support.
I hadn't realised that anyone else was working on this.
Comment 11 Joris Guisson 2005-09-12 11:45:11 UTC
Well, I'm interested in this class of yours as a temporary solution, it will probably take a while before this is implemented in KDE. And seeing that I'm not planning on switching to KNetwork until after the 1.1 release, UPnP support is at least 3 or 4 months away for KTorrent.
Comment 12 Thiago Macieira 2005-09-12 12:28:06 UTC
Well, seeing as I don't have any time to code this (I haven't started yet) and it's not in the feature list for KDE 3.5, I think we'd all benefit from your class. I'll later move it upstream to KNetwork, for KDE 4.
Comment 13 Joris Guisson 2005-11-11 16:57:07 UTC
Seeing that I'm working on my own implementation, I'm gonna take over this wish.
Comment 14 Joris Guisson 2005-11-11 16:58:53 UTC
*** Bug 110763 has been marked as a duplicate of this bug. ***
Comment 15 Joris Guisson 2005-11-13 18:39:33 UTC
SVN commit 480193 by guisson:

Added UPnP plugin to ktorrent

BUG: 108930



 M  +1 -1      ktorrent.kdevelop  
 M  +4 -4      libktorrent/util/Makefile.am  
 A             libktorrent/util/httprequest.cpp   [License: GPL (v2+) (wrong address)]
 A             libktorrent/util/httprequest.h   [License: GPL (v2+) (wrong address)]
 M  +1 -1      plugins/upnp/soap.cpp  
 M  +8 -0      plugins/upnp/upnpmcastsocket.cpp  
 M  +1 -0      plugins/upnp/upnpmcastsocket.h  
 M  +0 -4      plugins/upnp/upnpplugin.cpp  
 M  +18 -13    plugins/upnp/upnpprefwidget.cpp  
 M  +1 -4      plugins/upnp/upnpprefwidget.h  
 M  +43 -117   plugins/upnp/upnprouter.cpp  
 M  +15 -22    plugins/upnp/upnprouter.h  
Comment 16 Alexander van Loon 2005-11-14 20:25:29 UTC
Thank you so much Joris :).

It's been some time ago since I posted this bugreport, in the meanwhile I switched from KDE to GNOME 2.12 on Ubuntu Breezy, I like GNOME 2.12 more than KDE atm. But when the next Kubuntu release is out, I'll make sure to check KTorrent out again. You're doing a great job, and it's awesome that there finally is a good Bittorrent client for KDE with advanced features like UPnP.