delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/03/21/05:21:06

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Message-ID: <01da01c0b1f0$19ae88f0$104ada2f@europe.nortel.com>
X-Sybari-Space: 00000000 00000000 00000000
From: "Simon McCaughey" <simonmcc AT nortelnetworks DOT com>
To: cygwin <cygwin AT sources DOT redhat DOT com>
Subject: cygwin recv problem?
Date: Wed, 21 Mar 2001 10:17:14 -0000
MIME-Version: 1.0
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 5.00.2314.1300
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019