コード例 #1
0
ファイル: redis.py プロジェクト: hubo1016/vlcp
 def __init__(self):
     '''
     Constructor
     '''
     Protocol.__init__(self)
     self.usehiredis = hiredis_available and self.hiredis
     self._format_request_init(self.encoding)
コード例 #2
0
ファイル: redis.py プロジェクト: versee/vlcp
 def __init__(self):
     '''
     Constructor
     '''
     Protocol.__init__(self)
     self.usehiredis = hiredis_available and self.hiredis
     self._format_request_init(self.encoding)
コード例 #3
0
 def __init__(self, allowedVersions=None):
     '''
     Constructor
     '''
     Protocol.__init__(self)
     if allowedVersions is not None:
         self.allowedversions = allowedVersions
コード例 #4
0
ファイル: openflow.py プロジェクト: hubo1016/vlcp
 def __init__(self, allowedVersions = None):
     '''
     Constructor
     '''
     Protocol.__init__(self)
     if allowedVersions is not None:
         self.allowedversions = allowedVersions
コード例 #5
0
ファイル: openflow.py プロジェクト: dq5070410/vlcp
 def __init__(self, allowedVersions = None):
     '''
     Constructor
     
     :param allowedVersions: if specified, should be a tuple of allowed OpenFlow versions.
     '''
     Protocol.__init__(self)
     if allowedVersions is not None:
         self.allowedversions = allowedVersions
コード例 #6
0
ファイル: openflow.py プロジェクト: rubiruchi/vlcp
 def __init__(self, allowedVersions=None):
     '''
     Constructor
     
     :param allowedVersions: if specified, should be a tuple of allowed OpenFlow versions.
     '''
     Protocol.__init__(self)
     if allowedVersions is not None:
         self.allowedversions = allowedVersions
コード例 #7
0
ファイル: raw.py プロジェクト: vtanrun/vlcp
 def init(self, connection):
     for m in Protocol.init(self, connection):
         yield m
     connection.createdqueues.append(connection.scheduler.queue.addSubQueue(\
             self.messagepriority, RawConnectionStateEvent.createMatcher(connection = connection), ('connstate', connection)))
     for m in self.reconnect_init(connection):
         yield m
コード例 #8
0
ファイル: jsonrpc.py プロジェクト: hubo1016/vlcp
 def error(self, connection):
     for m in Protocol.error(self, connection):
         yield m
     connection.scheduler.ignore(JsonRPCRequestEvent.createMatcher(connection = connection))
     self._logger.warning('JSON-RPC connection is reset on %r', connection)
     for m in connection.waitForSend(JsonRPCConnectionStateEvent(JsonRPCConnectionStateEvent.CONNECTION_DOWN, connection, connection.connmark, self)):
         yield m
コード例 #9
0
ファイル: raw.py プロジェクト: dq5070410/vlcp
 def init(self, connection):
     for m in Protocol.init(self, connection):
         yield m
     connection.createdqueues.append(connection.scheduler.queue.addSubQueue(\
             self.messagepriority, RawConnectionStateEvent.createMatcher(connection = connection), ('connstate', connection)))
     for m in self.reconnect_init(connection):
         yield m
コード例 #10
0
ファイル: myprotocol.py プロジェクト: vtanrun/vlcp
 def error(self, connection):
     for m in Protocol.error(self, connection):
         yield m
     for m in connection.waitForSend(
             MyProtocolConnectionStateEvent(
                 MyProtocolConnectionStateEvent.DOWN, connection,
                 connection.connmark, self)):
         yield m
コード例 #11
0
ファイル: redis.py プロジェクト: versee/vlcp
 def notconnected(self, connection):
     for m in Protocol.notconnected(self, connection):
         yield m
     for m in connection.waitForSend(
             RedisConnectionStateEvent(
                 RedisConnectionStateEvent.CONNECTION_NOTCONNECTED,
                 connection, connection.connmark, self)):
         yield m
コード例 #12
0
ファイル: openflow.py プロジェクト: hubo1016/vlcp
 def error(self, connection):
     for m in Protocol.error(self, connection):
         yield m
     connection.handler.close()
     self._logger.warning('Openflow connection is reset on %r', connection)
     if connection.openflow_datapathid is not None:
         for m in connection.waitForSend(OpenflowConnectionStateEvent(connection.openflow_datapathid, connection.openflow_auxiliaryid, OpenflowConnectionStateEvent.CONNECTION_DOWN, connection, connection.connmark, self)):
             yield m
コード例 #13
0
ファイル: raw.py プロジェクト: dq5070410/vlcp
 def error(self, connection):
     for m in Protocol.error(self, connection):
         yield m
     for m in connection.inputstream.error(connection, True):
         yield m
     connection.terminate(connection._raw_writer)
     connection._raw_writer = None
     for m in connection.waitForSend(RawConnectionStateEvent(RawConnectionStateEvent.CONNECTION_DOWN, connection, connection.connmark, self)):
         yield m
コード例 #14
0
ファイル: redis.py プロジェクト: versee/vlcp
 def closed(self, connection):
     for m in Protocol.closed(self, connection):
         yield m
     self._logger.info('Redis connection is closed on %r', connection)
     for m in connection.waitForSend(
             RedisConnectionStateEvent(
                 RedisConnectionStateEvent.CONNECTION_DOWN, connection,
                 connection.connmark, self)):
         yield m
コード例 #15
0
ファイル: redis.py プロジェクト: versee/vlcp
 def error(self, connection):
     for m in Protocol.error(self, connection):
         yield m
     self._logger.warning('Redis connection is reset on %r', connection)
     for m in connection.waitForSend(
             RedisConnectionStateEvent(
                 RedisConnectionStateEvent.CONNECTION_DOWN, connection,
                 connection.connmark, self)):
         yield m
コード例 #16
0
ファイル: raw.py プロジェクト: hubo1016/vlcp
 def notconnected(self, connection):
     for m in Protocol.notconnected(self, connection):
         yield m
     for m in connection.waitForSend(
         RawConnectionStateEvent(
             RawConnectionStateEvent.CONNECTION_NOTCONNECTED, connection, connection.connmark, self
         )
     ):
         yield m
コード例 #17
0
ファイル: raw.py プロジェクト: missuzhang/vlcp
 def error(self, connection):
     for m in Protocol.error(self, connection):
         yield m
     for m in connection.inputstream.error(connection, True):
         yield m
     connection.terminate(connection._raw_writer)
     connection._raw_writer = None
     for m in connection.waitForSend(RawConnectionStateEvent(RawConnectionStateEvent.CONNECTION_DOWN, connection, connection.connmark, self)):
         yield m
コード例 #18
0
ファイル: myprotocol.py プロジェクト: dq5070410/vlcp
 def error(self, connection):
     for m in Protocol.error(self, connection):
         yield m
     for m in connection.waitForSend(
             MyProtocolConnectionStateEvent(
                 MyProtocolConnectionStateEvent.DOWN,
                 connection,
                 connection.connmark,
                 self)):
         yield m
コード例 #19
0
ファイル: testio.py プロジェクト: dq5070410/vlcp
 def init(self, connection):
     for m in Protocol.init(self, connection):
         yield m
     if not self.server:
         connection.subroutine(connection.executeWithTimeout(self.totalsend + 1.0, self._clientroutine(connection)), False, 'protocolroutine')
     else:
         for m in connection.write(ConnectionWriteEvent(connection, connection.connmark, data = b'', EOF = True)):
             yield m
     for m in connection.waitForSend(TestConnectionEvent(TestConnectionEvent.UP, connection)):
         yield m
コード例 #20
0
ファイル: jsonrpc.py プロジェクト: vtanrun/vlcp
 def error(self, connection):
     for m in Protocol.error(self, connection):
         yield m
     connection.scheduler.ignore(
         JsonRPCRequestEvent.createMatcher(connection=connection))
     self._logger.warning('JSON-RPC connection is reset on %r', connection)
     for m in connection.waitForSend(
             JsonRPCConnectionStateEvent(
                 JsonRPCConnectionStateEvent.CONNECTION_DOWN, connection,
                 connection.connmark, self)):
         yield m
コード例 #21
0
 def error(self, connection):
     for m in Protocol.error(self, connection):
         yield m
     connection.handler.close()
     self._logger.warning('Openflow connection is reset on %r', connection)
     if connection.openflow_datapathid is not None:
         for m in connection.waitForSend(
                 OpenflowConnectionStateEvent(
                     connection.openflow_datapathid,
                     connection.openflow_auxiliaryid,
                     OpenflowConnectionStateEvent.CONNECTION_DOWN,
                     connection, connection.connmark, self)):
             yield m
コード例 #22
0
ファイル: jsonrpc.py プロジェクト: versee/vlcp
 def init(self, connection):
     for m in Protocol.init(self, connection):
         yield m
     connection.createdqueues.append(connection.scheduler.queue.addSubQueue(\
             self.messagepriority, JsonRPCRequestEvent.createMatcher(connection = connection), ('request', connection), self.messagequeuesize))
     connection.createdqueues.append(connection.scheduler.queue.addSubQueue(\
             self.messagepriority, JsonRPCConnectionStateEvent.createMatcher(connection = connection), ('connstate', connection)))
     connection.createdqueues.append(connection.scheduler.queue.addSubQueue(\
             self.messagepriority + 1, JsonRPCResponseEvent.createMatcher(connection = connection), ('response', connection), self.messagequeuesize))
     connection.createdqueues.append(connection.scheduler.queue.addSubQueue(\
             self.messagepriority, JsonRPCNotificationEvent.createMatcher(connection = connection), ('notification', connection), self.messagequeuesize))
     for m in self.reconnect_init(connection):
         yield m
コード例 #23
0
ファイル: jsonrpc.py プロジェクト: hubo1016/vlcp
 def init(self, connection):
     for m in Protocol.init(self, connection):
         yield m
     connection.createdqueues.append(connection.scheduler.queue.addSubQueue(\
             self.messagepriority, JsonRPCRequestEvent.createMatcher(connection = connection), ('request', connection), self.messagequeuesize))
     connection.createdqueues.append(connection.scheduler.queue.addSubQueue(\
             self.messagepriority, JsonRPCConnectionStateEvent.createMatcher(connection = connection), ('connstate', connection)))
     connection.createdqueues.append(connection.scheduler.queue.addSubQueue(\
             self.messagepriority + 1, JsonRPCResponseEvent.createMatcher(connection = connection), ('response', connection), self.messagequeuesize))
     connection.createdqueues.append(connection.scheduler.queue.addSubQueue(\
             self.messagepriority, JsonRPCNotificationEvent.createMatcher(connection = connection), ('notification', connection), self.messagequeuesize))
     for m in self.reconnect_init(connection):
         yield m
コード例 #24
0
ファイル: redis.py プロジェクト: hubo1016/vlcp
 def init(self, connection):
     for m in Protocol.init(self, connection):
         yield m
     connection.createdqueues.append(connection.scheduler.queue.addSubQueue(\
             self.messagepriority - 1, RedisConnectionStateEvent.createMatcher(connection = connection), ('connstate', connection)))
     connection.createdqueues.append(connection.scheduler.queue.addSubQueue(\
             self.messagepriority + 1, RedisResponseEvent.createMatcher(connection = connection), ('response', connection), self.messagequeuesize))
     connection.createdqueues.append(connection.scheduler.queue.addSubQueue(\
             self.messagepriority + 1, RedisSubscribeEvent.createMatcher(connection = connection), ('subscribe', connection), self.messagequeuesize))
     connection.createdqueues.append(connection.scheduler.queue.addSubQueue(\
             self.messagepriority, RedisSubscribeMessageEvent.createMatcher(connection = connection), ('message', connection), self.messagequeuesize))
     connection.redis_subscribe = False
     connection.redis_select = None
     connection.redis_subscribe_keys = set()
     connection.redis_subscribe_pkeys = set()
     for m in self.reconnect_init(connection):
         yield m
コード例 #25
0
ファイル: redis.py プロジェクト: versee/vlcp
 def init(self, connection):
     for m in Protocol.init(self, connection):
         yield m
     connection.createdqueues.append(connection.scheduler.queue.addSubQueue(\
             self.messagepriority - 1, RedisConnectionStateEvent.createMatcher(connection = connection), ('connstate', connection)))
     connection.createdqueues.append(connection.scheduler.queue.addSubQueue(\
             self.messagepriority + 1, RedisResponseEvent.createMatcher(connection = connection), ('response', connection), self.messagequeuesize))
     connection.createdqueues.append(connection.scheduler.queue.addSubQueue(\
             self.messagepriority + 1, RedisSubscribeEvent.createMatcher(connection = connection), ('subscribe', connection), self.messagequeuesize))
     connection.createdqueues.append(connection.scheduler.queue.addSubQueue(\
             self.messagepriority, RedisSubscribeMessageEvent.createMatcher(connection = connection), ('message', connection), self.messagequeuesize))
     connection.redis_subscribe = False
     connection.redis_select = None
     connection.redis_subscribe_keys = set()
     connection.redis_subscribe_pkeys = set()
     for m in self.reconnect_init(connection):
         yield m
コード例 #26
0
ファイル: openflow.py プロジェクト: hubo1016/vlcp
 def init(self, connection):
     for m in Protocol.init(self, connection):
         yield m
     connection.createdqueues.append(connection.scheduler.queue.addSubQueue(\
             self.messagepriority, OpenflowPresetupMessageEvent.createMatcher(connection = connection), ('presetup', connection)))
     connection.createdqueues.append(connection.scheduler.queue.addSubQueue(\
             self.messagepriority, OpenflowConnectionStateEvent.createMatcher(connection = connection), ('connstate', connection)))
     connection.createdqueues.append(connection.scheduler.queue.addSubQueue(\
             self.messagepriority + 1, OpenflowResponseEvent.createMatcher(connection = connection), ('response', connection), self.messagequeuesize))
     connection.createdqueues.append(connection.scheduler.queue.addSubQueue(\
             self.messagepriority, OpenflowAsyncMessageEvent.createMatcher(connection = connection), ('async', connection), self.messagequeuesize))
     connection.createdqueues.append(connection.scheduler.queue.addSubQueue(\
             self.messagepriority, OpenflowExperimenterMessageEvent.createMatcher(connection = connection), ('experimenter', connection), self.messagequeuesize))
     # Add priority to echo reply, or the whole connection is down
     connection.createdqueues.append(connection.scheduler.queue.addSubQueue(\
             self.writepriority + 10, ConnectionWriteEvent.createMatcher(connection = connection, _ismatch = lambda x: hasattr(x, 'echoreply') and x.echoreply), ('echoreply', connection)))
     for m in self.reconnect_init(connection):
         yield m
コード例 #27
0
ファイル: testio.py プロジェクト: vtanrun/vlcp
 def init(self, connection):
     for m in Protocol.init(self, connection):
         yield m
     if not self.server:
         connection.subroutine(
             connection.executeWithTimeout(self.totalsend + 1.0,
                                           self._clientroutine(connection)),
             False, 'protocolroutine')
     else:
         for m in connection.write(
                 ConnectionWriteEvent(connection,
                                      connection.connmark,
                                      data=b'',
                                      EOF=True)):
             yield m
     for m in connection.waitForSend(
             TestConnectionEvent(TestConnectionEvent.UP, connection)):
         yield m
コード例 #28
0
 def init(self, connection):
     for m in Protocol.init(self, connection):
         yield m
     connection.createdqueues.append(connection.scheduler.queue.addSubQueue(\
             self.messagepriority, OpenflowPresetupMessageEvent.createMatcher(connection = connection), ('presetup', connection)))
     connection.createdqueues.append(connection.scheduler.queue.addSubQueue(\
             self.messagepriority, OpenflowConnectionStateEvent.createMatcher(connection = connection), ('connstate', connection)))
     connection.createdqueues.append(connection.scheduler.queue.addSubQueue(\
             self.messagepriority + 1, OpenflowResponseEvent.createMatcher(connection = connection), ('response', connection), self.messagequeuesize))
     connection.createdqueues.append(connection.scheduler.queue.addSubQueue(\
             self.messagepriority, OpenflowAsyncMessageEvent.createMatcher(connection = connection), ('async', connection), self.messagequeuesize))
     connection.createdqueues.append(connection.scheduler.queue.addSubQueue(\
             self.messagepriority, OpenflowExperimenterMessageEvent.createMatcher(connection = connection), ('experimenter', connection), self.messagequeuesize))
     # Add priority to echo reply, or the whole connection is down
     connection.createdqueues.append(connection.scheduler.queue.addSubQueue(\
             self.writepriority + 10, ConnectionWriteEvent.createMatcher(connection = connection, _ismatch = lambda x: hasattr(x, 'echoreply') and x.echoreply), ('echoreply', connection)))
     for m in self.reconnect_init(connection):
         yield m
コード例 #29
0
 def __init__(self):
     '''
     Constructor
     '''
     Protocol.__init__(self)
コード例 #30
0
ファイル: raw.py プロジェクト: hubo1016/vlcp
 def __init__(self):
     """
     Constructor
     """
     Protocol.__init__(self)
コード例 #31
0
ファイル: testio.py プロジェクト: dq5070410/vlcp
 def error(self, connection):
     for m in Protocol.closed(self, connection):
         yield m
     for m in connection.waitForSend(TestConnectionEvent(TestConnectionEvent.DOWN, connection)):
         yield m
コード例 #32
0
ファイル: testio.py プロジェクト: vtanrun/vlcp
 def error(self, connection):
     for m in Protocol.closed(self, connection):
         yield m
     for m in connection.waitForSend(
             TestConnectionEvent(TestConnectionEvent.DOWN, connection)):
         yield m
コード例 #33
0
ファイル: redis.py プロジェクト: hubo1016/vlcp
 def error(self, connection):
     for m in Protocol.error(self, connection):
         yield m
     self._logger.warning('Redis connection is reset on %r', connection)
     for m in connection.waitForSend(RedisConnectionStateEvent(RedisConnectionStateEvent.CONNECTION_DOWN, connection, connection.connmark, self)):
         yield m
コード例 #34
0
ファイル: jsonrpc.py プロジェクト: hubo1016/vlcp
 def __init__(self):
     '''
     Constructor
     '''
     Protocol.__init__(self)
コード例 #35
0
ファイル: myprotocol.py プロジェクト: dq5070410/vlcp
 def init(self, connection):
     for m in Protocol.init(self, connection):
         yield m
     for m in self.reconnect_init(connection):
         yield m
コード例 #36
0
ファイル: myprotocol.py プロジェクト: vtanrun/vlcp
 def init(self, connection):
     for m in Protocol.init(self, connection):
         yield m
     for m in self.reconnect_init(connection):
         yield m
コード例 #37
0
ファイル: redis.py プロジェクト: hubo1016/vlcp
 def closed(self, connection):
     for m in Protocol.closed(self, connection):
         yield m
     self._logger.info('Redis connection is closed on %r', connection)
     for m in connection.waitForSend(RedisConnectionStateEvent(RedisConnectionStateEvent.CONNECTION_DOWN, connection, connection.connmark, self)):
         yield m