Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change


by lhoward (Vicar)
on Mar 17, 2000 at 20:48 UTC ( #5549=user: print w/ replies, xml ) Need Help??

My main perl strengths are in using modules and in programming the outside perl including DBI, networking, IPC, signals, date and time computations, regular expressions, graphics manipulation, etc...

I enjoy playing chess. You can catch me on ICC playing as harbinger.

Les Howard
Author of Net::Syslog and Number::Spell .

Sample Code Posted Here

#!/usr/bin/perl -w use strict; use IO::Socket; use IO::Select; my $s=new IO::Select; my $ip1=IO::Socket::INET->new(LocalPort => 5925, Proto=>'udp', LocalAddr => '') or die "error creating UDP server $@\n"; my $ip2=IO::Socket::INET->new(LocalPort => 5925, Proto=>'udp', LocalAddr => '') or die "error creating UDP server $@\n"; $s->add($ip1); $s->add($ip2); while(1){ my $server; foreach $server($s->can_read(60)){ my $newmsg; $server->recv($newmsg,1024); my ($rport,$ripaddr) = sockaddr_in($server->peername); print "remote: ".inet_ntoa($ripaddr)."($rport)\n"; my ($lport,$lipaddr) = sockaddr_in($server->sockname); print "local: ".inet_ntoa($lipaddr)."($lport)\n"; } }

Log In?

What's my password?
Create A New User
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (3)
As of 2015-11-27 18:49 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (731 votes), past polls