Newsgroups : Borland : borland.public.delphi.internet.winsock : 2007 Jul : Using UDP to discover the server's IP address
| Subject: | Using UDP to discover the server's IP address |
| Posted by: | "Scott Slater" (scott@nospam.com) |
| Date: | Wed, 11 Jul 2007 16:30:01 |
I'm wondering if there is some example code or if someone would be kind
enough to outline how I can do the following:
I need a client to be able to periodically broadcast out on a particular
port looking for a response from a server that is listening on that port.
The client can then get the IP address of the server that responded and then
open a TCP connection to the server at that IP address on a different port.
Basically, the IP address of the server is unknown to the client when it
starts up. Only the port the server will be listening on is known. The
client needs to keep broadcasting an "are you there" message on that port
until it gets a response from the server. Ideally, this "are you there"
task should be in a background thread so the client can still do other
things while it is waiting for a response from the server.
Thanks in advance!
--
Scott Slater