[Zodb-checkins] CVS: ZEO/ZEO/zrpc - trigger.py:1.1.2.3

Jeremy Hylton jeremy@zope.com
Mon, 28 Jan 2002 18:42:56 -0500


Update of /cvs-repository/ZEO/ZEO/zrpc
In directory cvs.zope.org:/tmp/cvs-serv15310

Modified Files:
      Tag: Standby-branch
	trigger.py 
Log Message:
Implement a close() that closes both sides of the pipe.


=== ZEO/ZEO/zrpc/trigger.py 1.1.2.2 => 1.1.2.3 ===
 
 import asyncore
-#import asynchat
 
 import os
 import socket
@@ -135,6 +134,11 @@
             asyncore.file_dispatcher.__init__ (self, r)
             self.lock = thread.allocate_lock()
             self.thunks = []
+
+        def close(self):
+            self.del_channel()
+            self.socket.close() # the read side of the pipe
+            os.close(self.trigger) # the write side of the pipe
 
         def __repr__ (self):
             return '<select-trigger (pipe) at %x>' % id(self)