[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[minion-cvs] Add TOS flags to client connections; debug timeout impl...
Update of /home/minion/cvsroot/src/minion/lib/mixminion/server
In directory moria.mit.edu:/tmp/cvs-serv1772/lib/mixminion/server
Modified Files:
MMTPServer.py
Log Message:
Add TOS flags to client connections; debug timeout implementation.
Index: MMTPServer.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/lib/mixminion/server/MMTPServer.py,v
retrieving revision 1.70
retrieving revision 1.71
diff -u -d -r1.70 -r1.71
--- MMTPServer.py 11 Jan 2004 07:38:27 -0000 1.70
+++ MMTPServer.py 12 Jan 2004 00:49:00 -0000 1.71
@@ -111,9 +111,10 @@
self.connections[fd] = c
self.state[fd] = (wr,ww)
- def remove(self, c):
+ def remove(self, c, fd=None):
"""Remove a connection from this server."""
- fd = c.fileno()
+ if fd is None:
+ fd = c.fileno()
del self.connections[fd]
del self.state[fd]
@@ -128,7 +129,8 @@
# Maintain a set of filenos for connections we've checked, so we don't
# check any more than once.
for fd, con in self.connections.items():
- con.tryTimeout(cutoff)
+ if con.tryTimeout(cutoff):
+ self.remove(con,fd)
class PollAsyncServer(SelectAsyncServer):
"""Subclass of SelectAsyncServer that uses 'poll' where available. This
@@ -165,8 +167,9 @@
self.connections[fd] = c
mask = self.EVENT_MASK[(wr,ww)]
self.poll.register(fd, mask)
- def remove(self,c):
- fd = c.fileno()
+ def remove(self,c,fd=None):
+ if fd is None:
+ fd = c.fileno()
self.poll.unregister(fd)
del self.connections[fd]