Hi Paul,
It should be not too complicated to achieve such things with UDP Broadcast
and Multicast, the main problem IMO is the lack of proper documentation
how Multicast works. Long time ago, I have written a demo application,
which does the same things as what you need but I can remember that at the
beginning I must also discover it on Try & Error basic.
Basically the Sender uses the Indy Multicast Server Component (not the
Client Component!) to send out the message and the TIdUDPClient or
TIdUDPServer to broadcast:
- Multicast: you must specify the destination Multicast group, i.e:
224.255.255.001 and a port, i.e: 1978 than use
IdIPMCastServer1.Send('a Message') to send it out.
- UDP Broadcast: just use IdUDPServer1.Broadcast('Hello',<Port>) : <Port>
is the listening port.
On the Client: using the MCastClient and UDPServer respectively.
- Multicast: set the Multicast group i.e. 224.0.0.1 and the DefaultPort
than activate it to listen
- UDP Broadcast: set the DefaultPort than activate it.
Per onRead event handler you can write down to see what the client
actually received.
That is all!
On Wed, 16 Jul 2008 16:28:56 +0700, <[email protected]> wrote:
> Delphi (intermediate-level only)
> Messages In This Digest (1 Message)
>
> 1.
>
> UDP Broadcast From: Paul Bennett
> View All Topics | Create New Topic Message
>
> 1.
>
> UDP Broadcast
>
> Posted by: "Paul Bennett" [EMAIL PROTECTED] rm28157
>
> Wed Jul 16, 2008 2:24 am (PDT)
>
> I'm having real problems with this (which I'm sure is actually really
> easy).
>
> I'm working on a Client/Server application which will be running over
> our LAN. What I would like to do is when a Client starts up it sends a
> UDP broadcast to a specific Port which is being monitored by the
> Server app. When the server gets the broadcast it responds by sending
> a UDP message back to the originating client containing the servers IP
> address.
>
> All future traffic between Client and Server would then be Peer to
> Peer across TCP/IP.
>
> I have created two test apps, one broadcasts the UDP message (Client)
> and the other (Server) should respond, both apps contain UDPServer and
> UDPClient components. My problem is that the Server
> never seems to receive the Message.
>
> Can anyone either point me to some code that works that I could use
> that as my starting point, or explain, in words of one syllable how to
> achieve my aim?
>
> TIA
>
> Paul
>
> Back to top Reply to sender | Reply to group | Reply via web post
> Messages in this topic (1)
>
> Visit Your Group
>
> Yahoo! Finance
>
> It's Now Personal
>
> Guides, news,
>
> advice & more.
>
> New business?
>
> Get new customers.
>
> List your web site
>
> in Yahoo! Search.
>
> Dog Fanatics
>
> on Yahoo! Groups
>
> Find people who are
>
> crazy about dogs.
>
> Need to Reply?
>
> Click one of the "Reply" links to respond to a specific message in the
> Daily
> Digest.
>
> Create New Topic | Visit Your Group on the Web
>
> Messages
>
> -----------------------------------------------------
> Home page: http://groups.yahoo.com/group/delphi-en/
> To unsubscribe: [EMAIL PROTECTED]
>
> MARKETPLACE
>
> Special offer for Yahoo! Groups from Blockbuster! Get a free 1-month
> trial with
> no late fees or due dates.
>
>
> Change settings via the Web (Yahoo! ID required)
> Change settings via email: Switch delivery to Individual | Switch format
> to
> Traditional
> Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe
--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/