in reply to IO::Socket hangs reading data from server
!/usr/bin/perl use strict; use warnings; use Data::Dumper; use IO::Socket; my $socket = IO::Socket::INET->new( PeerAddr => 'all.dict.org', PeerPort => '2628', Proto => 'tcp', Timeout => 1, ReuseAddr => 1, MultiHomed => 1, Blocking => 0); die ("Could not create socket: $!\n") unless $socket; $socket->send("CLIENT dict4perl\n"); my $buf; while (sysread($socket, $buf, 1024)) { print $buf; } print "Done\n"; 1;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: IO::Socket hangs reading data from server
by halfbaked (Sexton) on Sep 09, 2010 at 00:24 UTC | |
by halfbaked (Sexton) on Sep 09, 2010 at 00:28 UTC |