Commit 4a4ec1a9 authored by Antoine Millet's avatar Antoine Millet

Internals RpcConnection watchers creation now use the public API

parent bf730fac
...@@ -75,19 +75,22 @@ class RpcConnection(object): ...@@ -75,19 +75,22 @@ class RpcConnection(object):
# Watcher list: # Watcher list:
self._watchers = set() self._watchers = set()
# Initialize main watcher:
self._sock_reader = self.loop.io(self._sock, pyev.EV_READ, self._dispatch)
self._sock_writer = self.loop.io(self._sock, pyev.EV_WRITE, self._writer)
self._watchers.add(self._sock_reader)
self._watchers.add(self._sock_writer)
# Socket inbound/outbound buffers: # Socket inbound/outbound buffers:
self._inbound_buffer = '' self._inbound_buffer = ''
self._outbound_buffer = '' self._outbound_buffer = ''
self._remains = struct.calcsize(RpcConnection.MESSAGE_HEADER_FALLBACK) self._remains = struct.calcsize(RpcConnection.MESSAGE_HEADER_FALLBACK)
self._proto_receiving = None self._proto_receiving = None
# Initialize main read/write watchers:
self._sock_reader = self.create_watcher(pyev.Io,
fd=self._sock,
events=pyev.EV_READ,
callback=self._dispatch)
self._sock_reader.start() self._sock_reader.start()
self._sock_writer = self.create_watcher(pyev.Io,
fd=self._sock,
events=pyev.EV_WRITE,
callback=self._writer)
# Is the RpcConnection connected to its peer: # Is the RpcConnection connected to its peer:
self._connected = True self._connected = True
......
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