Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Re: How to send Broadcast message

by ralijani (Acolyte)
on Jun 25, 2003 at 12:31 UTC ( [id://268835]=note: print w/replies, xml ) Need Help??


in reply to Re: How to send Broadcast message
in thread How to send Broadcast message

sory but i want to send message to all microsoft and linux client without any client application on my client
use IO::Socket::Multicast; # create a new UDP socket ready to read datagrams on port 1100 my $s = IO::Socket::Multicast->new(LocalPort=>1100); # Add a multicast group $s->mcast_add('225.0.1.1'); # Add a multicast group to eth0 device $s->mcast_add('225.0.0.2','eth0'); # now receive some multicast data $s->recv($data,1024); # Drop a multicast group $s->mcast_drop('225.0.0.1'); # Set outgoing interface to eth0 $s->mcast_if('eth0'); # Set time to live on outgoing multicast packets $s->mcast_ttl(10); # Turn off loopbacking $s->mcast_loopback(0); # Multicast a message to group 225.0.0.1 $s->mcast_send('hello world!','225.0.0.1:1200'); $s->mcast_set('225.0.0.2:1200'); $s->mcast_send('hello again!');

update (broquaint): added <code> tags

Replies are listed 'Best First'.
Re: Re: Re: How to send Broadcast message
by benn (Vicar) on Jun 25, 2003 at 13:27 UTC
    A 'client' is a 'client application' - you can broadcast messages wherever you like, but unless something's listening and acting on those messages, they're not a lot of good. You can't just send a message to a machine and expect it to magically do something...what were you expecting, exactly? mcast_send(PopupWindow=>1,PlaySound=>"ding.wav")? Anything that causes the client to take action must aleady be running on the client machine.

    Two paragraphs down fom the IO::Socket::Multicast synopsis you've pasted in there, it explains how to write a multicast client that will listen to your multicast server. That should get you started, if this is what you need.

    Cheers, Ben.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://268835]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (4)
As of 2024-04-19 12:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found