def __init__(self, connectionpool, ping_interval = 5*60, ping_timeout = 60):
        """
        :param connectionpool: Messaging system to use for low-level communication.
        
        :param ping_interval: Every `ping_interval` seconds we send for each unfinished
           call a message to our peers asking conformation that they are still working
           on it. If the peer has somehow 'lost' the call, or if we don't get a reply
           within `ping_timeout` seconds, the call will fail.
           
           This protects against unnoticed loss of connection, or if the remote process
           dies unexpectantly. In such cases the call might otherwise hang forever .
           
         :param ping_interval: See `ping_interval`-
        """
        self._connectionpool = connectionpool
        self._connectionpool.register_type(self._MESSAGE_TYPE)
        
        #: If :meth:`open` has finished.
        self._opened = False
        
        #: Local functions that may be invoked from remote.
        #: maps `functionid <-> callable`
        self._functions = bidict.bidict()
        
        #: Calls made from remote to here that are currently in progress.
        #: Maps `(peerid, callid)` -> `Deferred`.
        self._remote_to_local = {}
        
        #: Calls made from here to remote functions.
        #: Maps `(peerid, callid)` -> `Deferred`.
        self._local_to_remote = {}

        self._ping_interval = ping_interval
        self._ping_timeout = ping_timeout
        self._ping_loop = task.LoopingCall(self._ping_loop_iteration)
        self._ping_current_iteration = None # self._ping_loop.cancel() won't cancel an ongoing call, so we use this deferred.
        
        self._functions[self._PING] = self._ping
def __init__ ( self , connectionpool , ping_interval = 5 * 60 , ping_timeout = 60 ) : self . _connectionpool = connectionpool self . _connectionpool . register_type ( self . _MESSAGE_TYPE ) self . _opened = False self . _functions = bidict . bidict ( ) self . _remote_to_local = { } self . _local_to_remote = { } self . _ping_interval = ping_interval self . _ping_timeout = ping_timeout self . _ping_loop = task . LoopingCall ( self . _ping_loop_iteration ) self . _ping_current_iteration = None self . _functions [ self . _PING ] = self . _ping
:param connectionpool: Messaging system to use for low-level communication.
        
        :param ping_interval: Every `ping_interval` seconds we send for each unfinished
           call a message to our peers asking conformation that they are still working
           on it. If the peer has somehow 'lost' the call, or if we don't get a reply
           within `ping_timeout` seconds, the call will fail.
           
           This protects against unnoticed loss of connection, or if the remote process
           dies unexpectantly. In such cases the call might otherwise hang forever .
           
         :param ping_interval: See `ping_interval`-