Re: [Libbt-devel] added header files that will be installed
Brought to you by:
ksmathers
From: Peter S. <stu...@cd...> - 2005-02-11 15:12:55
|
On Fri, Feb 11, 2005 at 09:09:28AM +0100, Alien wrote: > bt.h also includes bttypes.h so it's easier not to make mistakes From btTorrent: int listenport; /* is this required??? */ No, listenport is not required, if we're going to do the networking in libbt I strongly suggest that we only use a single port per application, and by default one in the dynamic port range as defined by IANA, 49152 through 65536. Start from the bottom and try allocating upwards. The common 6881 port and thereabout are listed as: --8<-- http://www.iana.org/assignments/port-numbers # 6851-6887 Unassigned muse 6888/tcp MUSE muse 6888/udp MUSE # Muse Communications Corporation # <ho...@mu...> # 6889-6960 Unassigned -->8-- ..and hence not really a good fit. Also, there's no telling how many bt listeners may be active on a single host, so unless there's that global system mentioned before bt really shouldn't be allocated just a single port. And most importantly a dynamic port fits the application. This is not a server that peers will try to connect blindly to as a result of a user command, instead peer lists come from the tracker and so ports do not matter. --8<-- docs/protocol.txt, about communication between peers Next comes the 20 byte sha1 hash of the bencoded form of the 'info' value from the metainfo file. (This is the same value which is announced as info_hash to the tracker, only here it's raw instead of quoted here). If both sides don't send the same value, they sever the connection. The one possible exception is if a downloader wants to do multiple downloads over a single port, they may wait for incoming connections to give a download hash first, and respond with the same one if it's in their list. -->8-- This sounds good to me. //Peter |