On Thu, 25 Oct 2007 04:46:12 -, Josiah Carlson <[EMAIL PROTECTED]> wrote:
> [snip]
>But really, since I already wrote code that handles *all* of
>the timeout handling with a *single* time.time() call, and that also
>generally minimizes all explicit function calls, I'm not sure that
>your testin
Giampaolo Rodola' <[EMAIL PROTECTED]> writes:
> def readable(self):
> if time.time() >= self.timeout:
> self.send("Timeout")
> self.close()
> return 1
Don't do it this way. Put all the timeouts into a priority queue
(see the heapq module) so you only need to check the one
On Oct 23, 9:30 am, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote:
> On Tue, 23 Oct 2007 15:34:19 -, Josiah Carlson <[EMAIL PROTECTED]> wrote:
> > [snip]
>
> >Calling time.time() is relatively inexpensive in comparison to pure
> >Python function calls, but indeed, it could be a bottleneck.
>
>
On 23 Ott, 17:34, Josiah Carlson <[EMAIL PROTECTED]> wrote:
> On 22 Ott, 12:28, Giampaolo Rodola' <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > Hi there.
> > We're talking about an asyncore-based server.
> > Just for the heck of it I'd like to set a timeout which will
> > disconnects the clients if they
On Tue, 23 Oct 2007 15:34:19 -, Josiah Carlson <[EMAIL PROTECTED]> wrote:
> [snip]
>
>Calling time.time() is relatively inexpensive in comparison to pure
>Python function calls, but indeed, it could be a bottleneck.
Did you benchmark this on some system?
There isn't really any "pure Python fu
On 22 Ott, 12:28, Giampaolo Rodola' <[EMAIL PROTECTED]> wrote:
> Hi there.
> We're talking about an asyncore-based server.
> Just for the heck of it I'd like to set a timeout which will
> disconnects the clients if they're inactive (i.e., no command or data
> transfer in progress) for a long period
Hi there.
We're talking about an asyncore-based server.
Just for the heck of it I'd like to set a timeout which will
disconnects the clients if they're inactive (i.e., no command or data
transfer in progress) for a long period of time.
I was thinking about putting the timeout value into an attribut