delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2000/11/13/03:24:50

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: <3A0FA4E7.797F9C58@redhat.com>
Date: Mon, 13 Nov 2000 09:23:03 +0100
From: Corinna Vinschen <vinschen AT redhat DOT com>
X-Mailer: Mozilla 4.76 [en] (X11; U; Linux 2.2.14-SMP i686)
X-Accept-Language: de, en
MIME-Version: 1.0
To: Joe Clark <joeclark AT iastate DOT edu>
CC: cygwin AT sourceware DOT cygnus DOT com
Subject: Re: clock() and sleep(int) system calls
References: <4 DOT 2 DOT 0 DOT 58 DOT 20001113011419 DOT 00aab7f0 AT joeclark DOT mail DOT iastate DOT edu>

Joe Clark wrote:
> 
> Hello there.  I'm trying to build a socket-based program on WinNT 4, and
> I'd like to be able to combine clock() and sleep() in the program, but from
> my preliminary experiments, it appears that the sleep() function
> reinitializes the variable that clock() keeps track of -- so much for
> measuring elapsed time.  Is this documented somewhere?  Is there some good
> explanation for why it works this way?  Is there a way around it?
> 
> While I'm at it, for those who know socket programming, is there a way to
> "kill" a call to the accept(...) function, which normally blocks until a
> connection comes in?  I'd like to declare a maximum time for my server to
> run (say 5 minutes), and then have it exit normally.

You have to use `select' to wait for a connection only a specific
amount of time. When select reports that a connection should be
established only then call `accept'.

Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Developer                        mailto:cygwin AT sources DOT redhat DOT com
Red Hat, Inc.
mailto:vinschen AT redhat DOT com


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


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