Windows System Software -- Consulting, Training, Development -- Unique Expertise, Guaranteed Results

Home NTDEV

Before Posting...

Please check out the Community Guidelines in the Announcements and Administration Category.

More Info on Driver Writing and Debugging


The free OSR Learning Library has more than 50 articles on a wide variety of topics about writing and debugging device drivers and Minifilters. From introductory level to advanced. All the articles have been recently reviewed and updated, and are written using the clear and definitive style you've come to expect from OSR over the years.


Check out The OSR Learning Library at: https://www.osr.com/osr-learning-library/


RE: sockets

OSR_Community_UserOSR_Community_User Member Posts: 110,217
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" <[email protected]>
To: "NT Developers Interest List" <[email protected]>
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:[email protected]]
> 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:[email protected]]
> > 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 ;-)
> >
> >
> > ------------------------------------------------------------------------
> > Barak Mandelovich [email protected]
> > Mercury Interactive ltd.
> > ------------------------------------------------------------------------
> >
> >
> > -----Original Message-----
> > From: Girish Kulkarni [mailto:[email protected]]
> > 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: [email protected]
> > To unsubscribe send a blank email to $subst('Email.Unsub')
> >
> > ---
> > You are currently subscribed to ntdev as: [email protected]
> > To unsubscribe send a blank email to $subst('Email.Unsub')
>
> ---
> You are currently subscribed to ntdev as: [email protected]
> To unsubscribe send a blank email to $subst('Email.Unsub')
>
> ---
> You are currently subscribed to ntdev as: [email protected]
> To unsubscribe send a blank email to $subst('Email.Unsub')
>

Comments

  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    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
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. Sign in or register to get started.

Upcoming OSR Seminars
OSR has suspended in-person seminars due to the Covid-19 outbreak. But, don't miss your training! Attend via the internet instead!
Kernel Debugging 13-17 May 2024 Live, Online
Developing Minifilters 1-5 Apr 2024 Live, Online
Internals & Software Drivers 11-15 Mar 2024 Live, Online
Writing WDF Drivers 20-24 May 2024 Live, Online