How i can manager connection?

4 views
Skip to first unread message

berest

unread,
Dec 26, 2008, 9:34:02 PM12/26/08
to Net::BitTorrent
Sorry for my English.

In a simple client from package - created only one connection or not?

If the connection with peer was lost, how can I create/find other
peers and connect with them?

In other word - how i must work with many connection?

Sanko Robinson

unread,
Dec 29, 2008, 2:36:17 PM12/29/08
to Net::BitTorrent
Net::BitTorrent continually attempts new connections until we hit the
hard limit (currently 100 per torrent) so, unless some other problem
arrises[1], connecting to new peers should all be automatic.

[1] Problems like being firewalled, or tracker fails to provide a list
of peers, trackerless torrent and you haven't any nodes in your DHT
routing table, etc.
--
Sanko Robinson
sa...@cpan.org

Виктор

unread,
Dec 31, 2008, 6:01:35 AM12/31/08
to net-bit...@googlegroups.com


2008/12/29 Sanko Robinson <sa...@cpan.org>


In other bittorrent client i try download torrent - find 30 peers.
I run bittorrent.pl (from package Net-Bittorrent) - client find peers, but  run download ONLY from ONE peer (i see this in sniffer and iptstate). Then i block this peer in iptables -> timeout in client 1-2 minute -> then or close download or try download from other peer.
Other word - download used only ONE peer.
Why ?

Sanko Robinson

unread,
Dec 31, 2008, 1:54:24 PM12/31/08
to Net::BitTorrent
Could you tell me a little more about your setup? OS, perl version,
N::B version, etc.? And could you run the torrent with the debugging
script found in the SVN repository (http://net-
bittorrent.googlecode.com/svn/trunk/tatoeba/002-debug.pl)? It logs all
data transfers, connection attempts, etc. into a file called 'net-
bittorrent.log' in the current working directory.

The script generates loads of data that should not be made public so,
instead of posting it here, could you send me an email and attach the
'net-bittorrent.log' file to it? My address is below.
--
Sanko Robinson
sa...@cpan.org

Виктор

unread,
Jan 1, 2009, 2:07:22 PM1/1/09
to net-bit...@googlegroups.com


31 декабря 2008 г. 21:54 пользователь Sanko Robinson <sa...@cpan.org> написал:

OS - Debian GNU/Linux testing "Lenny" - Official RC i386 (20081104-07:33)
uname - Linux debian 2.6.28 #2 PREEMPT Thu Jan 1 17:36:57 MSK 2009 i686 GNU/Linux

perl -V
Summary of my perl5 (revision 5 version 10 subversion 0) configuration:
  Platform:
    osname=linux, osvers=2.6.26.1, archname=i486-linux-gnu-thread-multi
    uname='linux ninsei 2.6.26.1 #1 smp preempt sun aug 3 22:34:07 pdt 2008 i686 gnulinux '
    config_args='-Dusethreads -Duselargefiles -Dccflags=-DDEBIAN -Dcccdlflags=-fPIC -Darchname=i486-linux-gnu -Dprefix=/usr -Dprivlib=/usr/share/perl/5.10 -Darchlib=/usr/lib/perl/5.10 -Dvendorprefix=/usr -Dvendorlib=/usr/share/perl5 -Dvendorarch=/usr/lib/perl5 -Dsiteprefix=/usr/local -Dsitelib=/usr/local/share/perl/5.10.0 -Dsitearch=/usr/local/lib/perl/5.10.0 -Dman1dir=/usr/share/man/man1 -Dman3dir=/usr/share/man/man3 -Dsiteman1dir=/usr/local/man/man1 -Dsiteman3dir=/usr/local/man/man3 -Dman1ext=1 -Dman3ext=3perl -Dpager=/usr/bin/sensible-pager -Uafs -Ud_csh -Ud_ualarm -Uusesfio -Uusenm -DDEBUGGING=-g -Doptimize=-O2 -Duseshrplib -Dlibperl=libperl.so.5.10.0 -Dd_dosuid -des'
    hint=recommended, useposix=true, d_sigaction=define
    useithreads=define, usemultiplicity=define
    useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
    use64bitint=undef, use64bitall=undef, uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-O2 -g',
    cppflags='-D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing -pipe -I/usr/local/include'
    ccversion='', gccversion='4.3.2', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=4, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib /usr/lib64
    libs=-lgdbm -lgdbm_compat -ldb -ldl -lm -lpthread -lc -lcrypt
    perllibs=-ldl -lm -lpthread -lc -lcrypt
    libc=/lib/libc-2.7.so, so=so, useshrplib=true, libperl=libperl.so.5.10.0
    gnulibc_version='2.7'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
    cccdlflags='-fPIC', lddlflags='-shared -O2 -g -L/usr/local/lib'


Characteristics of this binary (from libperl):
  Compile-time options: MULTIPLICITY PERL_DONT_CREATE_GVSV
                        PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP USE_ITHREADS
                        USE_LARGE_FILES USE_PERLIO USE_REENTRANT_API
  Built under linux
  Compiled at Oct 19 2008 16:02:35
  @INC:
    /etc/perl
    /usr/local/lib/perl/5.10.0
    /usr/local/share/perl/5.10.0
    /usr/lib/perl5
    /usr/share/perl5
    /usr/lib/perl/5.10
    /usr/share/perl/5.10
    /usr/local/lib/site_perl


Net::Bittorrent - 0.042

net-bittorrent.log - attached.
net-bittorrent.log

Sanko Robinson

unread,
Jan 2, 2009, 2:15:57 PM1/2/09
to Net::BitTorrent
> [...]
>
> Net::Bittorrent - 0.042
>
> net-bittorrent.log - attached.

Hrm. You do seem to be snubbed more often than not (you'll have eight
half-open peers and at most, two 'ready') but that's probably due to
remote peers *demanding* encryption. In the next stable version (and
in r48 in SVN), N::B disconnects peers that stay half-open (fail to
complete a handshake) more than 30s instead of waiting for the OS to
tell us about a socket error. This should make gathering "good" peers
faster which may or may not help you out.

With so many ISPs and countries filtering or otherwise messing with
BitTorrent traffic, support for protocol encryption is becoming almost
required to participate fully in a swarm, so that's my next big task.
--
Sanko Robinson
sa...@cpan.org
Reply all
Reply to author
Forward
0 new messages