Re: Connect() blocks in endless loop test

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Mar 20, 2007 at 08:31:56PM +0100, Michal Feix wrote:
> Hello there,
> 
> if anybody here could help me out with this, I would be very gratefull.
> 
> While hunting for some "connect delays" on our network, I wrote a very simple 
> endless loop connecting and disconnecting to some TCP port. Loop consists of 
> a socket(), bind(), connect() and close(). It works fine for about 300 or so 
> iterations and then connect() blocks once for exactly 3 seconds. Loops then 
> continues normaly and after another few hundereds of iterations connect() 
> pauses again. And again, for 3 seconds. This happens also when testing 
> through loopback interface to localy listening TCP socket.
> 
> I believe this my problem is somehow connected with 
> http://uwsg.iu.edu/hypermail/linux/net/9710.3/0084.html as it's the only post 
> I found mentioning these 3 seconds timeouts. However, I try to bind to 
> arbitrary source port so I if got that post right, it should be working fine. 
> I tried to set tw_recycle and tw_reuse to 1 - but no success.
> 
> What am I missing here?
> 
In your test code, are you binding to the same port over and over again, or are
you letting bind pick a port number for you to bind to?  If you are doing the
latter, tw_recycle/reuse probably aren't going to help you much, since bind will
still try to find an non-conflicting port for you.  Try keeping tw_recycle/reuse
set to 1, and specify the port to bind to in your code

Neil

> -- 
> Michal Feix
> michal@xxxxxxx
> -
> To unsubscribe from this list: send the line "unsubscribe linux-net" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
-
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux