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

Re: Sending a low-level query using sockets? (A confused newbie)

by Thelonius (Priest)
on Mar 01, 2007 at 22:15 UTC ( #602794=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $peeraddr = $sock->recv($packet, $maxpacketsize);
    # 2048 should work fine as maxpacketetsize
    
  2. or download this
    if(! defined $sock->connected)
    
  3. or download this
    use IO::Socket;
    $p = IO::Socket::INET->new(PeerAddr => "1.1.1.1:7170", Proto => "udp")
       or die "socket: $!\n";
    if ($p->connected) { print "connect ok\n"}
    if ($p->write("foo")) { print "send ok\n"}
    
  4. or download this
    connect ok
    send ok
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (5)
As of 2020-07-13 05:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?