John (J5) Palmieri wrote:
...
The eggcupsutils stuff is just wrapping the CUPS APIs to manage the
whole request, including authentication, but it doesn't expose
enough to allow an event-driven (think select() or poll() on the FD)
application to "do the right thing" for truly asynchronous operation.
It does. eggcupsutils is just the layer between a mainloop and the low
level stuff. It provides the abstraction needed to integrate with a any
mainloop without having to recreate the wheel for every mainloop. If you
look at eggprintbackendcups I do just that and attach the fd of the http
request to poll. I admit it needs a bit of cleanup but it works.
I didn't see that when I looked, but in any case I think we'll
want something that communicates whether we are waiting to write or
read, which will determine which ends of the connection we want to
select() or poll() on.
There are also still blocking issues WRT authentication and
connecting to the server, so ultimately if we *do* add anything to
CUPS it will need to address them, too.
In the authentication case the request should go into a need
authentication state, the application would then setup an authenticated
connection and pass it to the request, starting the process again. That
Actually, the authentication challenge is an end state for a HTTP
request, so all of this really depends on how we want to model the
async request stuff, i.e. match the HTTP/IPP request model or come
up with a more general application request model?
is all stuff I want to figure out after the basics are done. As for
connections I don't see why we can't also figure out a way to wrap them
in an async API.
The problem with async connect() is that it isn't supported or
portable to all platforms. The Stevens book has some example code
that works on some platforms, and Microsoft has their own way of
doing things (yes, we do make sure that the client stuff, at least,
works on Windows too!), but we'll need something that can work on
all (or at least most) platforms.
--
______________________________________________________________________
Michael Sweet, Easy Software Products mike at easysw dot com
Internet Printing and Document Software http://www.easysw.com
_______________________________________________
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list