Article View: es.comp.os.linux.programacion
Article #10904Re: Pingear cada cierto tiempo
From: Santiago Romero
Date: Wed, 23 Jan 2002 09:57
Date: Wed, 23 Jan 2002 09:57
31 lines
1889 bytes
1889 bytes
El Tue, 22 Jan 2002 23:05:29 GMT, Er-Moi escribi๏ฟฝ:
> Tras la llamada a fork() esto es lo que tengo:
>
> do
> {
> if(send(sockb,"ping\n",5,0)==-1)
> info_remota.off=asctime(localtime(&tiempo));
>
> if((num_bytes_recv=recv(sockb,buffer,MAXRECV,0))==-1)
> info_remota.off=asctime(localtime(&tiempo));
>
> buffer[num_bytes_recv]='\0';
sleep(60);
>
> }while(!strcmp(buffer,"pong"));
>
> close(sockb);
> exit(0);
--
Santiago Romero
Departamento de Sistemas
sromero@servicom2000.com
Av. Primado Reig 189, entlo
46020 Valencia - Spain
Telf. (+34) 96 332 12 00
Fax. (+34) 96 332 12 01
http://www.servicom2000.com
Technical Details
Message-ID:
<slrna4t28a.i9l.sromero@compiler.servicom2000>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!fu-berlin.de!uni-berlin.de!top.servicom2000.COM!not-for-mailReferences:
<Zem38.159867$L27.618769@telenews.teleline.es>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: f86c8,e957887e69777942 X-Google-Attributes: gidf86c8,public X-Google-ArrivalTime: 2002-01-23 02:30:34 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!fu-berlin.de!uni-berlin.de!top.servicom2000.COM!not-for-mail From: Santiago Romero <sromero@servicom2000.com> Newsgroups: es.comp.os.linux.programacion Subject: Re: Pingear cada cierto tiempo Date: Wed, 23 Jan 2002 10:57:30 +0100 Lines: 32 Message-ID: <slrna4t28a.i9l.sromero@compiler.servicom2000> References: <Zem38.159867$L27.618769@telenews.teleline.es> Reply-To: sromero@servicom2000.com NNTP-Posting-Host: top.servicom2000.com (212.101.64.178) Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: fu-berlin.de 1011781833 35447024 212.101.64.178 (16 [39726]) X-Orig-Path: 127.0.0.1!nobody User-Agent: slrn/0.9.7.3 (Linux)