[Zodb-checkins] CVS: StandaloneZODB/ZEO/zrpc - connection.py:1.7

Jeremy Hylton jeremy@zope.com
Fri, 9 Aug 2002 16:32:50 -0400


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

Modified Files:
	connection.py 
Log Message:
Add a close() method to the ZEOStorage that closes connection to client.

XXX If select() raises an exception inside asyncore, close the connection. 


=== StandaloneZODB/ZEO/zrpc/connection.py 1.6 => 1.7 ===
--- StandaloneZODB/ZEO/zrpc/connection.py:1.6	Tue Aug  6 19:10:31 2002
+++ StandaloneZODB/ZEO/zrpc/connection.py	Fri Aug  9 16:32:49 2002
@@ -325,7 +325,12 @@
             # Do loop only if lock is already acquired.  XXX But can't
             # we already guarantee that the lock is already acquired?
             while not self.__reply_lock.acquire(0):
-                asyncore.poll(10.0, self._map)
+                try:
+                    asyncore.poll(10.0, self._map)
+                except select.error, err:
+                    log("Closing.  asyncore.poll() raised %s." % err,
+                        level=zLOG.BLATHER)
+                    self.close()
                 if self.closed:
                     raise DisconnectedError()
         self.__reply_lock.release()