Mail Archives: cygwin/2001/03/21/05:21:06
Hi all
problem with my perl =>
creating a IO::Socket::INET handle, when i call $handle->recv(....) it
doesnt seem to block?? anyone know about this?
works perfectly in 5.6.0 (activeperl, perl built for linux, and HP-UX)
I presume that its something to do with cygwin's 'c' recv() function
any help/hints welcome!!
Simon.
=======================================
versions and full code are below for anyone interested
perl version:
v5.6.1 built for cygwin
works with
v5.6.0 built for MSWin32-x86-multi-thread
v5.6.0 built for 9000/777-hpux
IO::Socket::INET version (all OSs) 1.25
================CODE=====================
sub _connect
{
my $self=shift;
my $interface=$self->{interface};
my %info=(Proto => "tcp",
PeerAddr => $self->{ip_address},
PeerPort => $self->{port},
);
p_debug("interface for $self->{name} [$self->{alias}] is
\"$interface\"...");
my $handle=$self->_check_for_registered_connection(%info,
interface => $interface,
);
if (! $handle)
{
p_user("open connection to inst_daemon ...");
$handle = IO::Socket::INET->new(%info,
Timeout => 4);
die "Could not connect to $self->{ip_address}:$self->{port}
via $interface" unless $handle;
p_user("connected successfully\n\n");
$handle->autoflush(1);
$self->_register_connection(%info,
interface => $interface,
handle => $handle
);
}
else
{
p_user("reusing existing connection\n");
}
$self->{connection}=$handle;
my $response;
print $handle "5%:SENS:DATA:TEL:TEST?";
$handle->recv($response,1000);
print "GOT:: : $response\n";
}
--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple
- Raw text -