lkml.org 
[lkml]   [1997]   [Aug]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Subjectbind sucks?
Date
I was wondering why mirroring a large site sometimes fails with "bind:
Address already in use" after having transferred a lot of files. It seems
to boil down to the following (fails in 2.0.30 and 2.0.30+pre4, not in
2.0.20). Notice strange regularity (724+725x, another run gave 719+740x,
another 325+740x).

> cat socktest.pl
#!/usr/bin/perl

for ($i=0; $i <100000 ; $i++) {
socket(S, 2,1,6);
bind(S, pack("S n a4 x8", 2, 0, "\0\0\0\0"))
|| print "bind $! $i " . $err++ . "\n";
close (S);
}
print "Errors: $err Total $i\n";
> ./socktest.pl
bind Address already in use 724 0
bind Address already in use 1449 1
bind Address already in use 2174 2
bind Address already in use 2899 3
bind Address already in use 3624 4
bind Address already in use 4349 5
bind Address already in use 5074 6
bind Address already in use 5799 7
bind Address already in use 6524 8
(cut)

-Topi

--
G? d s++:- a- C++ UL++++ P++++ L++>+++ E W+ N- !o K? w+ !O !M !V PS+
PE++ Y+ PGP++ !t 5? X+ !R tv b++ DI++ !D G+ e+++ h---- r+++ y?



\
 
 \ /
  Last update: 2005-03-22 13:40    [W:1.555 / U:0.004 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site