Tim Peters wrote at 2005-7-25 10:36 -0400:
>Yup. ZODB has what looks like a copy/paste of this code, in
>ZEO/zrpc/trigger.py. I didn't realize where it came from originally
>until you pointed out the Medusa code here.
>Anyway, it so happens I rewrote ZEO's copy a few weeks ago, in ZODB
>3.4. The Windows part is much simpler there now.
> # Specifying port 0 tells Windows to pick a port for us.
> a.bind(("127.0.0.1", 0))
> connect_address = a.getsockname() # assigned (host, port) pair
> r, addr = a.accept() # r becomes asyncore's (self.)socket
> self.trigger = w
This may even be portable (not Windows specific).
At least, it works for Linux2.
In this case, we might get rid of the stupid code duplication...
Zope maillist - Zope@zope.org
** No cross posts or HTML encoding! **
(Related lists -