Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Broadcast - Client 'finding' a server

1 view
Skip to first unread message

Brian Cahill

unread,
Jun 29, 1999, 3:00:00 AM6/29/99
to
I have a need for an IP client to locate an IP server dynamically - that is,
it needs to send out a "server - are you there" message and the server must
respond with sufficient info to let the client then establish full
communications.

How do you send a broadcast to a particular port AND how does the server
respond to a broadcast ??

Any suggestions ??

PS At this stage do NOT need to traverse a router - LAN traffic only

I have been trying using a TClientSocket and a TServerSocket but can change
if need be.

Thanks in advance,

Brian

Stephane Grobety

unread,
Jun 29, 1999, 3:00:00 AM6/29/99
to
You can obtain an exemple of UDP broadcast on François Piette's ICS exemples
(http://www.rtfm.be/fpiette/).

The idea is simple: use the UDP protocol and select a server port and start
listening on that port. On the client, use the IP address "255.255.255.255"
(that's the global broadcast address) with the same port as the server and
send a discover message to that socket. When the server receives it, it
sould send a response with it's IP address and you can then start a normal
IP connection.

Good luck,
Stephane

Brian Cahill <bca...@SoftHome.net> wrote in message
news:7l9oog$o3...@forums.borland.com...

Vance Kahching

unread,
Jun 29, 1999, 3:00:00 AM6/29/99
to
Brian Cahill wrote in message <7lbnhn$q2...@forums.borland.com>...
>I tried to broadcast to 255.255.255.255 using the WinShoes UDPClient but
it
>returns a 'host not found error'.
>
>However, if I use the actual IP address for the server, I get the expected
>response back.
To broadcast on your local network, assuming it's class c network, send
using the first three octets of the network with 255 as the last octet. For
example, if your network ip address begins with 172.16.2.xxx send to
172.16.2.255. All devices on the network 172.16.2.xxx will receive the
datagram. This only works on one local network. Over the Internet, you would
have to do something different like multicasting.
HTH
VK


Brian Cahill

unread,
Jun 30, 1999, 3:00:00 AM6/30/99
to
I tried to broadcast to 255.255.255.255 using the WinShoes UDPClient but it
returns a 'host not found error'.

However, if I use the actual IP address for the server, I get the expected
response back.

Can I use the Winshoes UDPClient component to broadcast ??

Having tried the Winshoes components, I think I would like to stay with
them - unless someone can convince me that I should tread another path.

Brian

Stephane Grobety <gro...@fulgan.com> wrote in message
news:7la1p2$op...@forums.borland.com...

0 new messages