[Stackless] Stackless WSGI http server..

Richard Tew richard.m.tew at gmail.com
Wed Apr 11 09:12:51 CEST 2007

On 4/10/07, Alec Flett <alecf at flett.org> wrote:
> I was actually able to just derive the Stackless HTTP Server class from the
> WSGIServer class and then it behaves as expected... and it flies! I'm really
> excited about this solution - I've already put together a little mini
> appserver for what I'm trying to accomplish.

That's great to hear :-)

> Also, there's a typo in stacklesssocket.py - probably originally from a
> comment I posted here a while back...
> The code for handle_connect currently says:
>             stackless.socket(self.connectChannel.send )(None)
> and should say:
>             stackless.tasklet(self.connectChannel.send)(None)

Are you sure you have the latest version of it?

The latest version has this as its handle_connect:

    def handle_connect(self):
        if self.socket.type != SOCK_DGRAM:
            if not self.connectChannel:
                self.connectChannel = stackless.channel()

You can get it from here:


> Now the next problem - how to use stacklessocket to do some kind of
> asynchat-like behavior (read/write chatty protocol terminated by linefeeds)
> for a separate socket connection I'm using. stacklessocket seems to
> constantly block my code on the read if the client calls socket.recv() with
> a bigger buffer than is available immediately.

This might be a mistake in my implementation.  I generally try and get
it to behave exactly the same as the socket module, given the
consideration that the user is actually using Stackless.

If you can demonstrate how it needs to work, I am happy to check in
a change to make it so.


Stackless mailing list
Stackless at stackless.com

More information about the Stackless mailing list