stream: By default disable probing on unix sockets.
[openvswitch] / python / ovs / stream.py
index 08c6293adf5a94f8b4d085b100fa849bfb641645..e2adaa5b0faa4c94394294454d13263aab7d9f83 100644 (file)
@@ -24,6 +24,19 @@ import ovs.vlog
 vlog = ovs.vlog.Vlog("stream")
 
 
+def stream_or_pstream_needs_probes(name):
+    """ 1 if the stream or pstream specified by 'name' needs periodic probes to
+    verify connectivty.  For [p]streams which need probes, it can take a long
+    time to notice the connection was dropped.  Returns 0 if probes aren't
+    needed, and -1 if 'name' is invalid"""
+
+    if PassiveStream.is_valid_name(name) or Stream.is_valid_name(name):
+        # Only unix and punix are supported currently.
+        return 0
+    else:
+        return -1
+
+
 class Stream(object):
     """Bidirectional byte stream.  Currently only Unix domain sockets
     are implemented."""