RE: sockets

You can send a PING (ICMP ECHO) request, then wait for the responce for some
reasonable amount of time (5 seconds?)
If you get the responce, then try the connection. If not go to the next
address.

If you want to get more sophisticated, send PINGS to all addresses on the
subnet without waiting for responces, then create a list of devices which
respond within the time limit (10 seconds?). Once you have this list try
the TCP connection.

Larry

----- Original Message -----
From: “Paul Bunn”
To: “NT Developers Interest List”
Sent: Thursday, July 27, 2000 1:06 PM
Subject: [ntdev] 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’)
>
> —
> You are currently subscribed to ntdev as: xxxxx@hrdcorp.com
> To unsubscribe send a blank email to $subst(‘Email.Unsub’)
>

At 01:01 PM 08/01/2000 -0500, /dev/null wrote:

Actually I think it is faster to develop an IOCP socket server than it is to
develop one any other way.

I would agree - once you possess the knowledge. But the learning curve for
IOCP-based sockets is far steeper than just cranking out some single
threaded blocking call code, and this guy’s question makes me suspect he’s a
lot closer to the latter than the former.

RLH