Connections with time-outs fail

Connections with time-outs fail

Post by RXVnZW5lIE » Thu, 27 Oct 2005 06:50:03


Hello.
I wrote simple scanner, that checks connection possibility at defined port
to number of hosts. I use non-blocked sockets, perform connect(), then
select() with timeout, checking socket for writing.
When i scan a number of hosts, many connections randomly fail, i.e. select()
returns false, WSAGetLastError() returns 0. Has anybody any assumptions about
this problem?
 
 
 

Connections with time-outs fail

Post by Alexander » Thu, 27 Oct 2005 09:38:10

That's a normal return value - means select timed out and
none of the sockets are ready. It's not false, it's zero, since
select() returns the number of sockets ready.

--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD
email: XXXX@XXXXX.COM
MVP VC FAQ: http://www.yqcomputer.com/
=====================================

 
 
 

Connections with time-outs fail

Post by RXVnZW5lIE » Thu, 27 Oct 2005 15:47:01


Sorry, i made this scanner in C# and VC++. In vc++ select returns 0, in c#
Poll returnds false. I've found where this problem figures out. Windows XP
has a limit to semi-opened sockets(that are in connection state) to 10 by
default, so when i overcome this limit i have troubles. But how can i differ
this situation from real impossibility to connect ?
 
 
 

Connections with time-outs fail

Post by Alun Jone » Fri, 28 Oct 2005 05:33:44


You can't. The limits were placed in XP to prevent XP machines from being
abused to spam - with the knowledge that the side-effects would make it
really hard to write a network scanner for XP.

You can either drop down to TDI / NDIS and write a low-level driver
component to manage your network scanning activity, or you can acknowledge
that XP is no longer a target platform for network scannres.

Alun.
~~~~
[Please don't email posters, if a Usenet response is appropriate.]
--
Texas Imperial Software | Find us at http://www.yqcomputer.com/ or email
23921 57th Ave SE | XXXX@XXXXX.COM .
Washington WA 98072-8661 | WFTPD, WFTPD Pro are Windows FTP servers.
Fax/Voice +1(425)807-1787 | Try our NEW client software, WFTPD Explorer.
 
 
 

Connections with time-outs fail

Post by Arkady Fre » Fri, 28 Oct 2005 15:23:11

But you do can differentiate both cases , because , when inbound connection
limit ocure you'll see event ID 4226 in the system log
Arkady
 
 
 

Connections with time-outs fail

Post by Alun Jone » Sat, 29 Oct 2005 04:59:26


That's "outbound" connection limit, but otherwise, you're somewhat right.

An outbound connection limit being exceeded will indeed cause event 4226 in
the event log, but there is no indication of which specific connection is
rejected because of exceeding the limit, as opposed to a connection being
rejected simply through time-out or other errors. [This is a flaw in the MS
TCP implementation, that you can't distinguish between time-out and reset]

Alun.
~~~~
[Please don't email posters, if a Usenet response is appropriate.]
--
Texas Imperial Software | Find us at http://www.yqcomputer.com/ or email
23921 57th Ave SE | XXXX@XXXXX.COM .
Washington WA 98072-8661 | WFTPD, WFTPD Pro are Windows FTP servers.
Fax/Voice +1(425)807-1787 | Try our NEW client software, WFTPD Explorer.
 
 
 

Connections with time-outs fail

Post by Arkady Fre » Sat, 29 Oct 2005 17:52:04

Oops , sure that outbound not inbound connection , that can't be other with
connect() :) ...
Arkady