diff options
Diffstat (limited to 'distbuild/sockbuf.py')
-rw-r--r-- | distbuild/sockbuf.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/distbuild/sockbuf.py b/distbuild/sockbuf.py index a7fe339a..346706db 100644 --- a/distbuild/sockbuf.py +++ b/distbuild/sockbuf.py @@ -77,6 +77,10 @@ class SocketBuffer(StateMachine): self._sock = sock self._max_buffer = max_buffer + def __repr__(self): + return '<SocketBuffer at 0x%x: socket %s max_buffer %i>' % ( + id(self), self._sock, self._max_buffer) + def setup(self): src = self._src = SocketEventSource(self._sock) src.stop_writing() # We'll start writing when we need to. @@ -85,6 +89,7 @@ class SocketBuffer(StateMachine): self._wbuf = StringBuffer() spec = [ + # state, source, event_class, new_state, callback ('reading', src, SocketReadable, 'reading', self._fill), ('reading', self, _WriteBufferNotEmpty, 'rw', self._start_writing), |