X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=python%2Fovs%2Fstream.py;h=82ea0c126c51ba462dd7f70b7f20a8ab2574e2db;hb=e0edde6fee279cdbbf3c179f5f50adaf0c7c7f1e;hp=08c6293adf5a94f8b4d085b100fa849bfb641645;hpb=7921b912de1e347f418a116f6d83f802dee655e2;p=sliver-openvswitch.git diff --git a/python/ovs/stream.py b/python/ovs/stream.py index 08c6293ad..82ea0c126 100644 --- a/python/ovs/stream.py +++ b/python/ovs/stream.py @@ -1,4 +1,4 @@ -# Copyright (c) 2010, 2011, 2012 Nicira Networks +# Copyright (c) 2010, 2011, 2012 Nicira, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -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."""