🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: es.comp.os.linux.programacion
Article #9385

Timeout en Connect() con Perl

#9385
From: Eva Riart
Date: Tue, 23 Jul 2002 17:36
21 lines
1604 bytes
Hola,

 Estoy programando un cliente TCP/IP en Perl, y tengo el c�digo siguiente:

    #intento de conexi�n a $host:$puerto

        socket(SOCKET,PF_INET,SOCK_STREAM,getprotobyname('tcp'));
        $iaddr = inet_aton($host);
        $paddr = sockaddr_in($puerto,$iaddr);

                          if (connect(SOCKET,$paddr)) {

     ........

  Me gustar�a saber si se puede especificar (y como) un timeout para que si
el $puerto
 de destino estuviara cerrado, no se "encallara" con el connect().

  Algui�n puede ayudarme??

                    Gracias!
Technical Details
Message-ID: <ahk44j$bkt$1@news.wanadoo.es>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!opentransit.net!newsfeed.comtenidos.com!newsfeeder.wanadoo.es!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: SPANISH,ASCII
X-Google-Thread: f86c8,e8389940e1fef874,start
X-Google-Attributes: gidf86c8,public
X-Google-ArrivalTime: 2002-07-23 10:51:52 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!opentransit.net!newsfeed.comtenidos.com!newsfeeder.wanadoo.es!not-for-mail
From: "Eva Riart" <evariart@hotmail.com>
Newsgroups: es.comp.os.linux.programacion
Subject: Timeout en Connect() con Perl
Date: Tue, 23 Jul 2002 19:36:32 +0200
Organization: Wanadoo
Lines: 25
Message-ID: <ahk44j$bkt$1@news.wanadoo.es>
NNTP-Posting-Host: 62-37-173-44.dialup.uni2.es
X-Trace: news.wanadoo.es 1027445716 11933 62.37.173.44 (23 Jul 2002 17:35:16 GMT)
X-Complaints-To: usenet@wanadoo.es
NNTP-Posting-Date: Tue, 23 Jul 2002 17:35:16 +0000 (UTC)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000