Commit 4dd996c2 authored by Aurel's avatar Aurel

add isListeningConnection method to differentiate connections


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@427 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 858cbdc6
...@@ -99,6 +99,9 @@ class BaseConnection(object): ...@@ -99,6 +99,9 @@ class BaseConnection(object):
def getUUID(self): def getUUID(self):
return None return None
def isListeningConnection(self):
raise NotImplementedError
class ListeningConnection(BaseConnection): class ListeningConnection(BaseConnection):
"""A listen connection.""" """A listen connection."""
def __init__(self, event_manager, handler, addr = None, def __init__(self, event_manager, handler, addr = None,
...@@ -120,6 +123,9 @@ class ListeningConnection(BaseConnection): ...@@ -120,6 +123,9 @@ class ListeningConnection(BaseConnection):
except ConnectorTryAgainException: except ConnectorTryAgainException:
pass pass
def isListeningConnection(self):
return True
class Connection(BaseConnection): class Connection(BaseConnection):
"""A connection.""" """A connection."""
def __init__(self, event_manager, handler, def __init__(self, event_manager, handler,
...@@ -318,6 +324,9 @@ class Connection(BaseConnection): ...@@ -318,6 +324,9 @@ class Connection(BaseConnection):
def isServerConnection(self): def isServerConnection(self):
raise NotImplementedError raise NotImplementedError
def isListeningConnection(self):
return False
class ClientConnection(Connection): class ClientConnection(Connection):
"""A connection from this node to a remote node.""" """A connection from this node to a remote node."""
def __init__(self, event_manager, handler, addr = None, def __init__(self, event_manager, handler, addr = None,
......
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