RE: sockets

I have a very limited understanding of Winsock and NDIS, etc, but:
Couldn’t you use a broadcast address and see which addresses respond ?
Failing that, if you’re not able to use a non-blocking socket call, I would
initiate 10-20 threads to concurrently try different ranges, using an I/O
completion port or similar.

Regards,

Paul Bunn, UltraBac.com, 425-644-6000
Microsoft MVP - WindowsNT/2000
http://www.ultrabac.com

-----Original Message-----
From: Girish Kulkarni [mailto:xxxxx@lightwave.com]
Sent: Thursday, July 27, 2000 8:57 AM
To: NT Developers Interest List
Subject: [ntdev] RE: sockets

hi !
i know that there is a machine out there
that has an IP address in the range 10.20.30.x to 10.20.30.y
now i want to find out what that IP address is … and then connect to it
using that address.

what i have tried is just to loop from 10.20.30.x to 10.20.30.y and try
connecting
using the connect call. it take a horrible amount of time before it can
connect, because each connect call takes a lot of time to time out if it
cannot connect.

i wanted to know if there was any faster way i could do that ? ? ?

-----Original Message-----
From: Barak Mandelovich [SMTP:xxxxx@mercury.co.il]
Sent: Thursday, July 27, 2000 11:48 AM
To: NT Developers Interest List
Subject: [ntdev] RE: sockets

Hi!

I hope I understood you correctly:
You want to know if a remote machine with
a specific IP address is on, and you can connect to it.

If this is the question - you can simply ping it.

If what you actually want is to know if it can
be connected via TCP (e.g.: telnet), I believe there’s
no other way but trying to connect.

Otherwise, to my knowledge, there’s no way to know.

You can, however, bypass the TCP/IP stack of the computer
by installing a MAC driver, build a TCP packet (SYN) by yourself,
send it and listen to the network until an ACK arrives.

This is similar to what connect() does, but in this way
YOU are the one who chooses the timeout value, and can
do things much faster.

Note, however, that this solution is quite complicated,
and you’ll need to write a kernel mode driver…

  • Barak

PS: If anybody knows of a better solution - please email me :wink:


Barak Mandelovich xxxxx@mercury.co.il
Mercury Interactive ltd.

-----Original Message-----
From: Girish Kulkarni [mailto:xxxxx@lightwave.com]
Sent: Thursday, July 27, 2000 3:58 PM
To: NT Developers Interest List
Subject: [ntdev] sockets

hi !
i want to find out if there is a m/c with, say, an ip address 10.20.30.40

to which i can connect.
how can i try to do that ?

if i use the connect call, it takes around a minute to time out.
is there any other way i can do that ?

tia
-girish


You are currently subscribed to ntdev as: xxxxx@mercury.co.il
To unsubscribe send a blank email to $subst(‘Email.Unsub’)


You are currently subscribed to ntdev as: xxxxx@lightwave.com
To unsubscribe send a blank email to $subst(‘Email.Unsub’)


You are currently subscribed to ntdev as: xxxxx@ultrabac.com
To unsubscribe send a blank email to $subst(‘Email.Unsub’)