Commit f7bb1d31 authored by Antoine Millet's avatar Antoine Millet

Added "Tunnel ready" feature to the TunnelProtocol

parent bb0e8209
......@@ -43,8 +43,8 @@ class TunnelProtocol(Protocol):
callback=self._handle_from_tunnel)
self._endpoint_writer = self._connection.create_watcher(pyev.Io, **props)
# Ask some data to the peer:
self._send_get(TunnelProtocol.GET_SIZE)
self._connection.rpc.send_special('protoctl', label=self._label,
type='ready')
def _handle_from_endpoint(self, watcher, revents):
'''
......@@ -96,3 +96,7 @@ class TunnelProtocol(Protocol):
size = payload.get('size', TunnelProtocol.DEFAULT_GET_SIZE)
self._ok_to_send += size
self._endpoint_reader.start()
elif control_type == 'ready':
self._send_get(TunnelProtocol.GET_SIZE)
self._ok_to_send += TunnelProtocol.GET_SIZE
self._endpoint_reader.start()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment