当前位置: 首页>>代码示例>>Python>>正文


Python base.AbstractTransportDispatcher类代码示例

本文整理汇总了Python中pysnmp.carrier.base.AbstractTransportDispatcher的典型用法代码示例。如果您正苦于以下问题:Python AbstractTransportDispatcher类的具体用法?Python AbstractTransportDispatcher怎么用?Python AbstractTransportDispatcher使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了AbstractTransportDispatcher类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: registerTransport

 def registerTransport(self, tDomain, transport):
     if self.loopingcall is None and self.getTimerResolution() > 0:
         self.loopingcall = asyncio.async(self.handle_timeout())
     AbstractTransportDispatcher.registerTransport(
         self, tDomain, transport
         )
     self.__transportCount += 1
开发者ID:437049211,项目名称:PyQYT,代码行数:7,代码来源:dispatch.py

示例2: registerTransport

 def registerTransport(self, tDomain, transport):
     if not self.loopingcall.running and self.getTimerResolution() > 0:
         self.loopingcall.start(self.getTimerResolution(), now = False)
     AbstractTransportDispatcher.registerTransport(
         self, tDomain, transport
         )
     self.__transportCount = self.__transportCount + 1
开发者ID:imron,项目名称:scalyr-agent-2,代码行数:7,代码来源:dispatch.py

示例3: registerTransport

 def registerTransport(self, tDomain, transport):
     if not self.loopingcall.running and self.timeout > 0:
         self.loopingcall.start(self.timeout, now = False)
     AbstractTransportDispatcher.registerTransport(
         self, tDomain, transport
         )
     self.__transportCount = self.__transportCount + 1
开发者ID:rolfschr,项目名称:testerman,代码行数:7,代码来源:dispatch.py

示例4: __init__

 def __init__(self, *args, **kwargs):
     AbstractTransportDispatcher.__init__(self)
     self.__transportCount = 0
     if 'timeout' in kwargs:
         self.setTimerResolution(kwargs['timeout'])
     self.loopingcall = task.LoopingCall(
         lambda self=self: self.handleTimerTick(time.time())
     )
开发者ID:imron,项目名称:scalyr-agent-2,代码行数:8,代码来源:dispatch.py

示例5: __init__

 def __init__(self, *args, **kwargs):
     AbstractTransportDispatcher.__init__(self)
     self.__transportCount = 0
     if 'timeout' in kwargs:
         self.setTimerResolution(kwargs['timeout'])
     else:
         self.setTimerResolution(1.0)            
     self.loopingcall = task.LoopingCall(self.handleTimeout)
开发者ID:carmackjia,项目名称:pysnmp,代码行数:8,代码来源:dispatch.py

示例6: __init__

    def __init__(self, io_loop=None):
        AbstractTransportDispatcher.__init__(self)

        self.io_loop = io_loop or IOLoop.current()
        self.timer = PeriodicCallback(self.on_timer,
            self.getTimerResolution()*1000, io_loop=self.io_loop)

        self.timer.start()
开发者ID:the-invoice,项目名称:pysnmp_tornado,代码行数:8,代码来源:dispatch.py

示例7: unregisterTransport

    def unregisterTransport(self, tDomain):
        t = AbstractTransportDispatcher.getTransport(self, tDomain)
        if t is not None:
            AbstractTransportDispatcher.unregisterTransport(self, tDomain)
            self.__transportCount = self.__transportCount - 1

        # The last transport has been removed, stop the timeout
        if self.__transportCount == 0 and self.loopingcall.running:
            self.loopingcall.stop()
开发者ID:imron,项目名称:scalyr-agent-2,代码行数:9,代码来源:dispatch.py

示例8: unregisterTransport

    def unregisterTransport(self, tDomain):
        t = AbstractTransportDispatcher.getTransport(self, tDomain)
        if t is not None:
            AbstractTransportDispatcher.unregisterTransport(self, tDomain)
            self.__transportCount -= 1

        # The last transport has been removed, stop the timeout
        if self.__transportCount == 0 and not self.loopingcall.done():
            self.loopingcall.cancel()
            self.loopingcall = None
开发者ID:437049211,项目名称:PyQYT,代码行数:10,代码来源:dispatch.py

示例9: __init__

    def __init__(self, *args, **kwargs):
        AbstractTransportDispatcher.__init__(self)

        self.__transportCount = 0

        if 'timeout' in kwargs:
            self.setTimerResolution(kwargs['timeout'])

        self.loopingcall = None
        self.loop = kwargs.pop('loop', asyncio.get_event_loop())
开发者ID:etingof,项目名称:pysnmp,代码行数:10,代码来源:dispatch.py

示例10: registerTransport

    def registerTransport(self, tDomain, transport):
        if self.loopingcall is None and self.getTimerResolution() > 0:
            # Avoid deprecation warning for asyncio.async()
            if IS_PYTHON_344_PLUS:
                self.loopingcall = asyncio.ensure_future(self.handle_timeout())

            else:
                self.loopingcall = getattr(asyncio, 'async')(self.handle_timeout())

        AbstractTransportDispatcher.registerTransport(
            self, tDomain, transport
        )

        self.__transportCount += 1
开发者ID:etingof,项目名称:pysnmp,代码行数:14,代码来源:dispatch.py

示例11: __init__

 def __init__(self, *args, **kwargs):
     AbstractTransportDispatcher.__init__(self)
     self.__transportCount = 0
     self.timeout = kwargs.get('timeout', 1.0)
     self.loopingcall = task.LoopingCall(self.handleTimeout)
开发者ID:rolfschr,项目名称:testerman,代码行数:5,代码来源:dispatch.py

示例12: __init__

 def __init__(self):
     self.__sockMap = {} # use own map for MT safety
     self.timeout = 0.5
     AbstractTransportDispatcher.__init__(self)
开发者ID:437049211,项目名称:PyQYT,代码行数:4,代码来源:dispatch.py


注:本文中的pysnmp.carrier.base.AbstractTransportDispatcher类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。