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


Python SocketServer.StreamRequestHandler类代码示例

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


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

示例1: finish

    def finish(self):
        """ do some cleanup here... ie remove all the
            devices connected to that machine """

        # remove the device
        getDevMgr().removeDevice(self.deviceId)
        StreamRequestHandler.finish(self)
开发者ID:MattHung,项目名称:sage-graphics,代码行数:7,代码来源:listener.py

示例2: __init__

 def __init__(self, *args, **kwargs):
     self.commands = dict((cmd, getattr(self, "_%s" % cmd.lower())) for cmd in COMMANDS)
     self.client = None
     self.player = None
     self.game = None
     self.servicing = True
     StreamRequestHandler.__init__(self, *args, **kwargs)
开发者ID:batkinson,项目名称:checkers,代码行数:7,代码来源:threaded_server.py

示例3: setup

 def setup(self):
     global hb_timeout
     StreamRequestHandler.setup(self)
     self.request.settimeout(hb_timeout)
     self._request_process = {
         HEARTBEAT_REQUEST:self._heartbeat_process,
         REPLACE_REQUEST:self._replace_process
     }
     self.timestamp = None
开发者ID:sdgdsffdsfff,项目名称:dshb,代码行数:9,代码来源:dshb.py

示例4: __init__

 def __init__(self, *args, **kwargs):
     self.proxy_object = kwargs.pop('proxy_object', self)
     # LOL, standard library stuff is old style class
     #
     # super(CborRpcHandler, self).__init__(*args, **kwargs)
     #
     # So, call the super constructor the old way ...
     # Work gets done in the constructor! WTF!
     StreamRequestHandler.__init__(self, *args, **kwargs)
开发者ID:diffeo,项目名称:coordinate,代码行数:9,代码来源:server.py

示例5: setup

    def setup(self):
        self.sb = "\x0b"
        self.eb = "\x1c"
        self.cr = "\x0d"
        self.validator = re.compile(self.sb + "(([^\r]+\r)*([^\r]+\r?))" + self.eb + self.cr)
        self.handlers = self.server.handlers
        self.timeout = self.server.timeout

        StreamRequestHandler.setup(self)
开发者ID:charan0312,项目名称:dump,代码行数:9,代码来源:mllp.py

示例6: __init__

 def __init__(self, id_, *args, **kwargs):
     self._id = id_
     self._peer = config["peer"]
     # self._tgt_ip = config["target_ip"]
     # self._tgt_port = config["target_port"]
     self._tcp_sock = None
     self._icmp_sock = None
     self._thread = None
     StreamRequestHandler.__init__(self, *args, **kwargs)
开发者ID:jinxingxing,项目名称:ICMPTunnel,代码行数:9,代码来源:client.py

示例7: setup

 def setup(self):
     
     StreamRequestHandler.setup(self)
     
     self._controller = FlightController.getInstance()
     self._controller.start()
     
     #self._throttle = 0.0        
     self._started = False
开发者ID:hisie,项目名称:eaglebone,代码行数:9,代码来源:dispatching.py

示例8: __init__

 def __init__(self,*args,**kwargs):
     if isinstance(SensorRecvTCPServerHandler.mongo_connection, SensorMongoORM) is not True:
         initializationConfigParser = InitializationConfigParser("ServerConfig.ini")
         databaseConnectConfig = initializationConfigParser.GetAllNodeItems("DataBase")
         databaseConnectConfig["port"] = int(databaseConnectConfig.get("port"))
         SensorRecvTCPServerHandler.mongo_connection = SensorMongoORM(**databaseConnectConfig)
         logging.info(SensorRecvTCPServerHandler.mongo_connection)
     self.terminal_owner = None
     self.terminal_address = None
     StreamRequestHandler.__init__(self,*args,**kwargs)
开发者ID:zthxxx,项目名称:python-flask-IoT_Sensor_Web,代码行数:10,代码来源:SensorRecvTCPServer.py

示例9: setup

    def setup(self):
        self.sb = b"\x0b"
        self.eb = b"\x1c"
        self.cr = b"\x0d"
        self.validator = re.compile(
            ''.join([self.sb.decode('ascii'), r"(([^\r]+\r)*([^\r]+\r?))", self.eb.decode('ascii'), self.cr.decode('ascii')]))
        self.handlers = self.server.handlers
        self.timeout = self.server.timeout

        StreamRequestHandler.setup(self)
开发者ID:crs4,项目名称:hl7apy,代码行数:10,代码来源:mllp.py

示例10: setup

 def setup(self):
     
     StreamRequestHandler.setup(self)
     
     self._controller = FlightController.getInstance()
     self._controller.setPidThrottleThreshold(Dispatcher.PID_THROTTLE_THRESHOLD)
     self._controller.start()
     
     self._throttleByUser = False
     self._throttle = 0.0        
     self._started = False
开发者ID:dpm76,项目名称:eaglebone,代码行数:11,代码来源:dispatching.py

示例11: __init__

 def __init__(self, request, client_address, server): 
      self.connection_time = datetime.today()
      self.last_connection_check = datetime.today()
      self.in_data = None
      self.out_data = None
      self.control = server.control
      self.read_errors = 0
      self.write_errors = 0
      self.request_errors = 0
      self.client_full_address = "%s:%s" % (client_address[0], 
                                            client_address[1]) 
      StreamRequestHandler.__init__(self, request, client_address, server)
开发者ID:juanchitot,项目名称:domo,代码行数:12,代码来源:network_handler.py

示例12: finish

 def finish(self):
     StreamRequestHandler.finish(self)
     # Remove this handler from the conversations dict
     print('close %s:%d' % self.client_address)
     if self._conversation_id is not None:
         with conversations_lock:
             handlers = conversations[self._conversation_id]
             handlers.remove(self)
             if not handlers:
                 del conversations[self._conversation_id]
             print_conversation(self._conversation_id, handlers)
         self._conversation_id = None
开发者ID:splatspace,项目名称:esprelay,代码行数:12,代码来源:esprelay.py

示例13: setup

 def setup(self):
     StreamRequestHandler.setup(self)
     self._tcp_sock = self.request
     icmp = socket.getprotobyname("icmp")
     self._icmp_sock = socket.socket(socket.AF_INET, socket.SOCK_RAW, icmp)
     # send_data = ICMPPacket.create(ICMP_ECHO, 0, self._id, 0, "")
     # self._icmp_sock.sendto(send_data, (self._peer, 0))
     seq = 0
     send_data = ICMPPacket.create(ICMP_ECHO, 0, self._id, seq, "xnew")
     logger.debug("[%d]# new connection", self._id)
     while self._tcp_sock:
         self._icmp_sock.sendto(send_data, (self._peer, 0))
         rfds, _, _ = select.select([self._icmp_sock], [], [], 0.1)
         if not rfds:
             continue
         data, addr = self._icmp_sock.recvfrom(MAX_BUF_LEN)
         _, id_, r_seq, payload = ICMPPacket.parse(data)
         # print addr[0], self._peer, id_, self._id, r_seq, seq
         if addr[0] == self._peer and id_ == self._id and \
                         r_seq == seq and payload == "xnew":
             logger.debug("[%d]# conn success", self._id)
             break
开发者ID:jinxingxing,项目名称:ICMPTunnel,代码行数:22,代码来源:client.py

示例14: __init__

 def __init__(self, request, client_address, server):
   self._read_buffer = ""
   StreamRequestHandler.__init__(self, request, client_address, server)
开发者ID:najeira,项目名称:pyapns,代码行数:3,代码来源:test.py

示例15: __init__

 def __init__(self, *args, **kwargs):
     StreamRequestHandler.__init__(self, *args, **kwargs)
开发者ID:crs4,项目名称:hl7apy,代码行数:2,代码来源:mllp.py


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