예제 #1
0
 def open_unreliably(jsonrpc):
     reconnect = ovs.reconnect.Reconnect(ovs.timeval.msec())
     reconnect.set_quiet(True)
     reconnect.set_name(jsonrpc.name)
     reconnect.set_max_tries(0)
     reconnect.connected(ovs.timeval.msec())
     return Session(reconnect, jsonrpc)
예제 #2
0
파일: jsonrpc.py 프로젝트: M3S/ovs-rstp
 def open_unreliably(jsonrpc):
     reconnect = ovs.reconnect.Reconnect(ovs.timeval.msec())
     reconnect.set_quiet(True)
     reconnect.set_name(jsonrpc.name)
     reconnect.set_max_tries(0)
     reconnect.connected(ovs.timeval.msec())
     return Session(reconnect, jsonrpc)
예제 #3
0
파일: jsonrpc.py 프로젝트: M3S/ovs-rstp
    def open(name, probe_interval=None):
        """Creates and returns a Session that maintains a JSON-RPC session to
        'name', which should be a string acceptable to ovs.stream.Stream or
        ovs.stream.PassiveStream's initializer.

        If 'name' is an active connection method, e.g. "tcp:127.1.2.3", the new
        session connects and reconnects, with back-off, to 'name'.

        If 'name' is a passive connection method, e.g. "ptcp:", the new session
        listens for connections to 'name'.  It maintains at most one connection
        at any given time.  Any new connection causes the previous one (if any)
        to be dropped.

        If "probe_interval" is zero it disables the connection keepalive
        feature. If non-zero the value will be forced to at least 1000
        milliseconds. If None it will just use the default value in OVS.
        """
        reconnect = ovs.reconnect.Reconnect(ovs.timeval.msec())
        reconnect.set_name(name)
        reconnect.enable(ovs.timeval.msec())

        if ovs.stream.PassiveStream.is_valid_name(name):
            reconnect.set_passive(True, ovs.timeval.msec())

        if not ovs.stream.stream_or_pstream_needs_probes(name):
            reconnect.set_probe_interval(0)
        elif probe_interval is not None:
            reconnect.set_probe_interval(probe_interval)

        return Session(reconnect, None)
예제 #4
0
    def open(name, probe_interval=None):
        """Creates and returns a Session that maintains a JSON-RPC session to
        'name', which should be a string acceptable to ovs.stream.Stream or
        ovs.stream.PassiveStream's initializer.

        If 'name' is an active connection method, e.g. "tcp:127.1.2.3", the new
        session connects and reconnects, with back-off, to 'name'.

        If 'name' is a passive connection method, e.g. "ptcp:", the new session
        listens for connections to 'name'.  It maintains at most one connection
        at any given time.  Any new connection causes the previous one (if any)
        to be dropped.

        If "probe_interval" is zero it disables the connection keepalive
        feature. If non-zero the value will be forced to at least 1000
        milliseconds. If None it will just use the default value in OVS.
        """
        reconnect = ovs.reconnect.Reconnect(ovs.timeval.msec())
        reconnect.set_name(name)
        reconnect.enable(ovs.timeval.msec())

        if ovs.stream.PassiveStream.is_valid_name(name):
            reconnect.set_passive(True, ovs.timeval.msec())

        if not ovs.stream.stream_or_pstream_needs_probes(name):
            reconnect.set_probe_interval(0)
        elif probe_interval is not None:
            reconnect.set_probe_interval(probe_interval)

        return Session(reconnect, None)
예제 #5
0
    def open(name):
        """Creates and returns a Session that maintains a JSON-RPC session to
        'name', which should be a string acceptable to ovs.stream.Stream or
        ovs.stream.PassiveStream's initializer.

        If 'name' is an active connection method, e.g. "tcp:127.1.2.3", the new
        session connects and reconnects, with back-off, to 'name'.

        If 'name' is a passive connection method, e.g. "ptcp:", the new session
        listens for connections to 'name'.  It maintains at most one connection
        at any given time.  Any new connection causes the previous one (if any)
        to be dropped."""
        reconnect = ovs.reconnect.Reconnect(ovs.timeval.msec())
        reconnect.set_name(name)
        reconnect.enable(ovs.timeval.msec())

        if ovs.stream.PassiveStream.is_valid_name(name):
            reconnect.set_passive(True, ovs.timeval.msec())

        return Session(reconnect, None)
예제 #6
0
    def open(name):
        """Creates and returns a Session that maintains a JSON-RPC session to
        'name', which should be a string acceptable to ovs.stream.Stream or
        ovs.stream.PassiveStream's initializer.
        
        If 'name' is an active connection method, e.g. "tcp:127.1.2.3", the new
        session connects and reconnects, with back-off, to 'name'.
        
        If 'name' is a passive connection method, e.g. "ptcp:", the new session
        listens for connections to 'name'.  It maintains at most one connection
        at any given time.  Any new connection causes the previous one (if any)
        to be dropped."""
        reconnect = ovs.reconnect.Reconnect(ovs.timeval.msec())
        reconnect.set_name(name)
        reconnect.enable(ovs.timeval.msec())

        if ovs.stream.PassiveStream.is_valid_name(name):
            reconnect.set_passive(True, ovs.timeval.msec())

        return Session(reconnect, None)