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


Python StreamRequestHandler.setup方法代码示例

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


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

示例1: setup

# 需要导入模块: from SocketServer import StreamRequestHandler [as 别名]
# 或者: from SocketServer.StreamRequestHandler import setup [as 别名]
    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,代码行数:11,代码来源:mllp.py

示例2: setup

# 需要导入模块: from SocketServer import StreamRequestHandler [as 别名]
# 或者: from SocketServer.StreamRequestHandler import setup [as 别名]
 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,代码行数:11,代码来源:dshb.py

示例3: setup

# 需要导入模块: from SocketServer import StreamRequestHandler [as 别名]
# 或者: from SocketServer.StreamRequestHandler import setup [as 别名]
 def setup(self):
     
     StreamRequestHandler.setup(self)
     
     self._controller = FlightController.getInstance()
     self._controller.start()
     
     #self._throttle = 0.0        
     self._started = False
开发者ID:hisie,项目名称:eaglebone,代码行数:11,代码来源:dispatching.py

示例4: setup

# 需要导入模块: from SocketServer import StreamRequestHandler [as 别名]
# 或者: from SocketServer.StreamRequestHandler import setup [as 别名]
    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,代码行数:12,代码来源:mllp.py

示例5: setup

# 需要导入模块: from SocketServer import StreamRequestHandler [as 别名]
# 或者: from SocketServer.StreamRequestHandler import setup [as 别名]
 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,代码行数:13,代码来源:dispatching.py

示例6: setup

# 需要导入模块: from SocketServer import StreamRequestHandler [as 别名]
# 或者: from SocketServer.StreamRequestHandler import setup [as 别名]
 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,代码行数:24,代码来源:client.py

示例7: setup

# 需要导入模块: from SocketServer import StreamRequestHandler [as 别名]
# 或者: from SocketServer.StreamRequestHandler import setup [as 别名]
 def setup(self):
     StreamRequestHandler.setup(self)
     self.keep_alive = True
     self.handshake_done = False
     self.valid_client = False
开发者ID:Pithikos,项目名称:python-websocket-server,代码行数:7,代码来源:websocket_server.py

示例8: setup

# 需要导入模块: from SocketServer import StreamRequestHandler [as 别名]
# 或者: from SocketServer.StreamRequestHandler import setup [as 别名]
 def setup(self):
     self.server.handlers.add(self)
     StreamRequestHandler.setup(self)
开发者ID:kret0s,项目名称:gnuhealth-live,代码行数:5,代码来源:common.py

示例9: setup

# 需要导入模块: from SocketServer import StreamRequestHandler [as 别名]
# 或者: from SocketServer.StreamRequestHandler import setup [as 别名]
 def setup(self):
     StreamRequestHandler.setup(self)
     self.objectStream = wrapSocketForPickle(self.connection)
     self.intoMeetingPlace()
开发者ID:niccokunzmann,项目名称:agents,代码行数:6,代码来源:SimplePickleServer.py

示例10: setup

# 需要导入模块: from SocketServer import StreamRequestHandler [as 别名]
# 或者: from SocketServer.StreamRequestHandler import setup [as 别名]
 def setup(self):
     print('connect %s:%d' % self.client_address)
     StreamRequestHandler.setup(self)
开发者ID:splatspace,项目名称:esprelay,代码行数:5,代码来源:esprelay.py

示例11: setup

# 需要导入模块: from SocketServer import StreamRequestHandler [as 别名]
# 或者: from SocketServer.StreamRequestHandler import setup [as 别名]
 def setup(self):
     
     StreamRequestHandler.setup(self)
开发者ID:dpm76,项目名称:eaglebone,代码行数:5,代码来源:dummy_listener.py


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