[Twisted-Python] pb over windows named pipes?

Eric Mangold teratorn at twistedmatrix.com
Tue Jun 20 18:26:48 MDT 2006


On Wed, 21 Jun 2006 04:55:36 +1000, Micky Latowicki <ml.flex at gmail.com>  
wrote:

> Thank you glyph and Itamar.
>
> The idea to use named pipes occured to us very late in our dev. process,  
> at
> a point where we really have to do things quickly. We think that we  
> should
> adopt named pipes nonetheless because they should save us a lot of other
> work.
>
> Looking at WaitForMultipleObjects, it doesn't seem like named pipes fit.  
> We
> would have to use overlapping IO and events for that.

WaitForMultipleObjects can be used with named pipes, and yes, you will  
create Event objects and use overlapping IO with it.

See, for example,  
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ipc/base/named_pipe_server_using_overlapped_i_o.asp

I don't really have any idea how easily this would fit in  
win32eventreactor... anyone?

>
> Since we use wxreactor, we probably can't use win32eventreactor as-is.
>
> What is most accessible to us, we think, it to create threads and block.  
> So
> that's what we're going to do, at least until we have time to do  
> something
> nicer. We will contribute it, if we think it's good. We probably won't  
> think
> it's much good, though. Sorry.
>
> Thanks again.

Yeah, Twisted doesn't have any real support for combining reactors (and  
maybe it's not really feasible), but that's a topic for another thread :)

> On 20/06/06, Itamar Shtull-Trauring <itamar at itamarst.org> wrote:
>>
>> On Tue, 2006-06-20 at 14:03 -0400, glyph at divmod.com wrote:
>>
>> > >2. how hard would it be
>> >
>> > To do it properly?  You can't select() on named pipes in Windows, so
>> > you'd have to work with IOCP, which I unfortunately understand only at
>> > a high level.  Hopefully someone who has worked with iocpreactor can
>> > answer your questions (hint, hint).
>>
>> That's not completely accurate. I'm faily certain you can use named
>> pipes with WaitForMultipleObjects, so you could probably implement this
>> relatively easily with the win32eventreactor.
>>
>> If they support non-blocking operations it should be easy to implement
>> using t.i.abstract.FileDescriptor as a basis; if they don't you can
>> probably steal most of the code from the win32 process support.

-- 
Eric Mangold - Twisted/Win32 Maintainer
http://twistedmatrix.com/trac/wiki/Windows




More information about the Twisted-Python mailing list