當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。