Well back to UDP, I asked a similar question on here must be over a year or
two now.  Someone was a great help and got me going.
So I will include here a chatter2.pl which sends a UDP message.  And
listener2.pl that listens on UDP and writes the messages to a log and to
the screen.

Since UDP sends IP address the listener also reads the local hosts file to
put out a human name instead of a number if possible.

I hope these help, note also that I'm using port 514, you will want to
change this as 514 is actually used by Unix to forward SYSLOG.
Also this was written to run on windows with cygwin installed.  cygwin is
just used to time stamp and check dates so this could easy be removed
and if you turn off log writing etc.  I used the date to check if I should
rotate the logs.

Well find attached two .pl files.

Basil Daoust
Automation Services

(See attached file: listener2.pl)(See attached file: chatter2.pl)


                                                                                       
                                                            
                      Adam Ingerman                                                    
                                                            
                      <[EMAIL PROTECTED]>         To:       [EMAIL PROTECTED]          
                                
                      Sent by:                              cc:                        
                                                            
                      [EMAIL PROTECTED]        Subject:  UDP server howto?             
                                               
                      veState.com                                                      
                                                            
                                                                                       
                                                            
                                                                                       
                                                            
                      01/10/2003 07:53 AM                                              
                                                            
                      Please respond to OZ_Prophet                                     
                                                            
                                                                                       
                                                            
                                                                                       
                                                            



I've been working with TCP so far, and there's enough in the fine manual to

know how to do TCP... but it falls a bit short on the differences in how to

set up a UDP server. I've had a bit of a google around, but I haven't found

much there either..

I've played around a bit with two scripts on the command line (which are
probably wrong anyway, so not much point in posting them, I just want a bit

of info on how setting up an IO::Socket::INET with UDP is different) and
had
no luck. I don't know if one or both of them is broken.

if someone could show me a bit of info on how to set it up, or (even
better) a
pair of scripts that can talk from one to the other via UDP (even if it's
just a '1' every second).
However, what I want to do with this, is have a pulse-update send out over
the
Internet (a message of a few hundred bytes every 60sec, for example), and
it
would be wasteful to send the same info to each client individually... if
I'm
looking at doing something too complicated, please let me know that too 8^)

TIA

Adam
--
Quidquid latine dictum sit, altum viditur.

(Whatever is said in Latin sounds profound.)

_______________________________________________
ActivePerl mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



Attachment: listener2.pl
Description: Binary data

Attachment: chatter2.pl
Description: Binary data

Reply via email to