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):
def getUUID(self):
return None
def isListeningConnection(self):
raise NotImplementedError
class ListeningConnection(BaseConnection):
"""A listen connection."""
def __init__(self, event_manager, handler, addr = None,
......@@ -120,6 +123,9 @@ class ListeningConnection(BaseConnection):
except ConnectorTryAgainException:
pass
def isListeningConnection(self):
return True
class Connection(BaseConnection):
"""A connection."""
def __init__(self, event_manager, handler,
......@@ -318,6 +324,9 @@ class Connection(BaseConnection):
def isServerConnection(self):
raise NotImplementedError
def isListeningConnection(self):
return False
class ClientConnection(Connection):
"""A connection from this node to a remote node."""
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