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


Python UDPServer.__init__方法代码示例

本文整理汇总了Python中SocketServer.UDPServer.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python UDPServer.__init__方法的具体用法?Python UDPServer.__init__怎么用?Python UDPServer.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SocketServer.UDPServer的用法示例。


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

示例1: __init__

# 需要导入模块: from SocketServer import UDPServer [as 别名]
# 或者: from SocketServer.UDPServer import __init__ [as 别名]
    def __init__(self, HOST='localhost', PORT=4000, handler=KodemonUDPHandler, db_conn_string='sqlite:///AppData/Kodemon.sqlite'):
        #Set up the server
        UDPServer.__init__(self, (HOST, PORT), handler)

        #Set up the database connection
        engine = create_engine(db_conn_string)
        self.Session = sessionmaker(bind=engine)
开发者ID:bjornheidar,项目名称:veff-proj,代码行数:9,代码来源:KodemonUDPServer.py

示例2: __init__

# 需要导入模块: from SocketServer import UDPServer [as 别名]
# 或者: from SocketServer.UDPServer import __init__ [as 别名]
 def __init__(self, server_address, RequestHandlerClass):
     UDPServer.__init__(self, server_address, RequestHandlerClass)
     self._shutdown_request = False
     
     # watchdog guards against the failure mode when the remote target fails 
     # to send any packets. If the watchdog reaches the high water mark, the 
     # server is terminated so as not to leave the server thread unterminated
     self.watchdog = 0.0
开发者ID:Koenma413,项目名称:sal-stack-lwip,代码行数:10,代码来源:sal_udpserver.py

示例3: __init__

# 需要导入模块: from SocketServer import UDPServer [as 别名]
# 或者: from SocketServer.UDPServer import __init__ [as 别名]
    def __init__ (self):   
        from app import APP
        port = APP.BE.LOGGING._i_server_port

        UDPServer.__init__(self, ('127.0.0.1', port), None)
        Process.__init__ (self, None, None, "pcLOG" )        
        
        self.queue = Queue( APP.BE.LOGGING._i_queue_size )        
        self.backend = LoggingBackend (self.queue)
        self.backend.start()
        self.on = True
        self.start()
开发者ID:amamitzsch,项目名称:docsis-provisioning,代码行数:14,代码来源:log.py

示例4: __init__

# 需要导入模块: from SocketServer import UDPServer [as 别名]
# 或者: from SocketServer.UDPServer import __init__ [as 别名]
    def __init__(self, regnancy_server_address):

        for port in xrange(12000, 25000):
            try:
                logging.info("UDPServer starts")
                UDPServer.__init__(self, ("", port), Handler)
                logging.info("UDPServer runs %i", port)
                break
            except:
                pass

        self.timeout = 0.05
        RegnancyUDPServer.regnancy_server_address = \
            regnancy_server_address
        self.running = True
开发者ID:EssEf,项目名称:Regnancy,代码行数:17,代码来源:regnancyupdserver.py

示例5: __init__

# 需要导入模块: from SocketServer import UDPServer [as 别名]
# 或者: from SocketServer.UDPServer import __init__ [as 别名]
    def __init__(self, args):
        """Instantiate an OSCServer.
        server_address ((host, port) tuple): the local host & UDP-port
        the server listens on
        """
        self.address_family = args.address_family

        self.args = args
        self.own_address = client_host, client_port = resolve_host(args.client_host, args.client_port, self.address_family, socket.AI_PASSIVE)
        self.chaosc_address = chaosc_host, chaosc_port = resolve_host(args.chaosc_host, args.chaosc_port, self.address_family)

        logger.info("binding to %s:%r", client_host, client_port)
        UDPServer.__init__(self, self.own_address, OSCRequestHandler)

        self.socket.setblocking(0)
        if hasattr(args, "subscribe") and args.subscribe:
            self.subscribe_me()

        self.callbacks = {}
开发者ID:DerLiveCode,项目名称:chaosc,代码行数:21,代码来源:simpleOSCServer.py

示例6: __init__

# 需要导入模块: from SocketServer import UDPServer [as 别名]
# 或者: from SocketServer.UDPServer import __init__ [as 别名]
 def __init__(self, address=("239.255.255.250", 1900), handler_class=SSDPHandler):
     
     
     self._notifications = list()
     self._scheduled_timers = list()
     
     UDPServer.__init__(self, address, handler_class, bind_and_activate = False)
     
     # needed to receive multicast messages
     mreq = struct.pack("=4sl", socket.inet_aton("239.255.255.250"), socket.INADDR_ANY)
     self.socket.setsockopt(socket.IPPROTO_IP, socket.IP_ADD_MEMBERSHIP, mreq)         
     self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
     self.socket.setsockopt(socket.IPPROTO_IP, socket.IP_MULTICAST_TTL, 2)
     self.socket.setsockopt(socket.IPPROTO_IP, socket.IP_MULTICAST_LOOP, 1)
     
     
     self.notification_socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
     
     
     self.server_bind()
     self.server_activate()
开发者ID:stereohead,项目名称:pynplay,代码行数:23,代码来源:ssdpserver.py

示例7: __init__

# 需要导入模块: from SocketServer import UDPServer [as 别名]
# 或者: from SocketServer.UDPServer import __init__ [as 别名]
 def __init__(self, server_address, RequestHandlerClass, container,
              thread_class = Thread):
     UDPServer.__init__(self, server_address, RequestHandlerClass)
     CustomThreadingMixIn.__init__(self, thread_class)
     self.container = container
     self.daemon_threads = True
开发者ID:DFectuoso,项目名称:culter,代码行数:8,代码来源:rpc.py

示例8: __init__

# 需要导入模块: from SocketServer import UDPServer [as 别名]
# 或者: from SocketServer.UDPServer import __init__ [as 别名]
 def __init__(self, local_address = ('127.0.0.1', 69) ):
     UDPServer.__init__(self, local_address, None)
开发者ID:amamitzsch,项目名称:docsis-provisioning,代码行数:4,代码来源:Server.py

示例9: __init__

# 需要导入模块: from SocketServer import UDPServer [as 别名]
# 或者: from SocketServer.UDPServer import __init__ [as 别名]
 def __init__(self, server_address, RequestHandlerClass, config):
     self.config = config
     UDPServer.__init__(self, server_address, RequestHandlerClass)
开发者ID:jaysw,项目名称:bdns,代码行数:5,代码来源:bdns.py

示例10: __init__

# 需要导入模块: from SocketServer import UDPServer [as 别名]
# 或者: from SocketServer.UDPServer import __init__ [as 别名]
 def __init__(self, cdn_name, server_address, handler_class=DNSUDPHandler):
     self.name = cdn_name
     UDPServer.__init__(self, server_address, handler_class)
     return
开发者ID:vaibhavsingh1993,项目名称:CS5700,代码行数:6,代码来源:dnsserver.py

示例11: __init__

# 需要导入模块: from SocketServer import UDPServer [as 别名]
# 或者: from SocketServer.UDPServer import __init__ [as 别名]
 def __init__(self, **kwargs):
     host = kwargs.get('host', '127.0.0.1')
     port = int(kwargs.get('port', 8881))
     UDPServer.__init__(self, (host, port), WowzaHandler)
     self.db = DbLogger(**kwargs)
开发者ID:nocarryr,项目名称:wowza-ec2-bootstrapper,代码行数:7,代码来源:udp_logger.py


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