Alaska Software Inc. - Sockets
Username: Password:
AuthorTopic: Sockets
Adrian WykrotaSockets
on Mon, 02 Jun 2003 18:17:07 +0200
How to get list of servers who'is listening any port (my own port)

--
Adrian Wykrota
Poland
http://www.systemy.comers.pl/alaska
Mike EvansRe: Sockets
on Thu, 05 Jun 2003 10:36:17 +0300
Adrian
I think that you must send a broadcast message from your client and when a server receive it must reply with the needed
informations. The bad think is that i don't know how to do it.

Regards
Mike Evans

"Adrian Wykrota" <a.wykrota@comers.pl> wrote in message news:3edb77eb@asgcom.alaska-software.com...
> How to get list of servers who'is listening any port (my own port)
>
> --
> Adrian Wykrota
> Poland
> http://www.systemy.comers.pl/alaska
>
>
Frans VermeulenRe: Sockets
on Thu, 05 Jun 2003 10:42:07 +0200
Mike,

> I think that you must send a broadcast message from your client and when a server receive it must reply with
the needed
> informations. The bad think is that i don't know how to do it.

A broadcast is AFAIK a message to the "255" addres of a (sub)net.
To really know if a server is listening, I think you must actually connect to it.

This leaves Adrian no alternative but:

For nNeta:=0 to 255
   For nNetb:=0 to 255
      For nNetc:=0 To 255
         For nNetd:=1 to 254    0 is bit-bucket, 255 is broadcast address)
            If SocketConnect(bla.....)

It might be possible to do this for a smaller range of IP-numbers,
and it might also be shortened by doing a gethostby... to see if something
is at the other side.

I have written a ICmp class in the past (Internet control message protocol)
with which you can do a ping or a traceroute. I'm afraid I have found no
API for sending other control messages, which could facilitate the above
procedure 

HTH, (but I'm afraid it won't)
Frans Vermeulen

PS. search the net for "LanPortScan", it's a free utility for portscans.
See how this program works, it does actually connect to the computers.
Adrian WykrotaRe: Sockets
on Thu, 05 Jun 2003 15:59:08 +0200
Thanks for you thinks. It is idea. I must read range of ip adress of local
area from registry and seek in this area. OK. Thank you once again.

--
Adrian Wykrota
Poland
http://www.systemy.comers.pl/alaska
Uytkownik "Frans Vermeulen" <f.vermeulen@ehp.nl> napisa w wiadomoci
news:3edf0176@asgcom.alaska-software.com...
> Mike,
>
> > I think that you must send a broadcast message from your client and when
a server receive it must reply with
> the needed
> > informations. The bad think is that i don't know how to do it.
>
> A broadcast is AFAIK a message to the "255" addres of a (sub)net.
> To really know if a server is listening, I think you must actually connect
to it.
>
> This leaves Adrian no alternative but:
>
> For nNeta:=0 to 255
>    For nNetb:=0 to 255
>       For nNetc:=0 To 255
>          For nNetd:=1 to 254    0 is bit-bucket, 255 is broadcast
address)
>             If SocketConnect(bla.....)
>
> It might be possible to do this for a smaller range of IP-numbers,
> and it might also be shortened by doing a gethostby... to see if something
> is at the other side.
>
> I have written a ICmp class in the past (Internet control message
protocol)
> with which you can do a ping or a traceroute. I'm afraid I have found no
> API for sending other control messages, which could facilitate the above
> procedure 
>
> HTH, (but I'm afraid it won't)
> Frans Vermeulen
>
> PS. search the net for "LanPortScan", it's a free utility for portscans.
> See how this program works, it does actually connect to the computers.
>
>