예제 #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
 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
 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