當前位置: 首頁>>代碼示例>>Python>>正文


Python http1connection.HTTP1ServerConnection方法代碼示例

本文整理匯總了Python中tornado.http1connection.HTTP1ServerConnection方法的典型用法代碼示例。如果您正苦於以下問題:Python http1connection.HTTP1ServerConnection方法的具體用法?Python http1connection.HTTP1ServerConnection怎麽用?Python http1connection.HTTP1ServerConnection使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在tornado.http1connection的用法示例。


在下文中一共展示了http1connection.HTTP1ServerConnection方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: handle_stream

# 需要導入模塊: from tornado import http1connection [as 別名]
# 或者: from tornado.http1connection import HTTP1ServerConnection [as 別名]
def handle_stream(self, stream, address):
        context = _HTTPRequestContext(stream, address,
                                      self.protocol)
        conn = HTTP1ServerConnection(
            stream, self.conn_params, context)
        self._connections.add(conn)
        conn.start_serving(self) 
開發者ID:tao12345666333,項目名稱:tornado-zh,代碼行數:9,代碼來源:httpserver.py

示例2: handle_stream

# 需要導入模塊: from tornado import http1connection [as 別名]
# 或者: from tornado.http1connection import HTTP1ServerConnection [as 別名]
def handle_stream(self, stream: iostream.IOStream, address: Tuple) -> None:
        context = _HTTPRequestContext(
            stream, address, self.protocol, self.trusted_downstream
        )
        conn = HTTP1ServerConnection(stream, self.conn_params, context)
        self._connections.add(conn)
        conn.start_serving(self) 
開發者ID:opendevops-cn,項目名稱:opendevops,代碼行數:9,代碼來源:httpserver.py

示例3: on_close

# 需要導入模塊: from tornado import http1connection [as 別名]
# 或者: from tornado.http1connection import HTTP1ServerConnection [as 別名]
def on_close(self, server_conn: object) -> None:
        self._connections.remove(typing.cast(HTTP1ServerConnection, server_conn)) 
開發者ID:opendevops-cn,項目名稱:opendevops,代碼行數:4,代碼來源:httpserver.py

示例4: handle_stream

# 需要導入模塊: from tornado import http1connection [as 別名]
# 或者: from tornado.http1connection import HTTP1ServerConnection [as 別名]
def handle_stream(self, stream, address):
        context = _HTTPRequestContext(stream, address,
                                      self.protocol,
                                      self.trusted_downstream)
        conn = HTTP1ServerConnection(
            stream, self.conn_params, context)
        self._connections.add(conn)
        conn.start_serving(self) 
開發者ID:tp4a,項目名稱:teleport,代碼行數:10,代碼來源:httpserver.py

示例5: initialize

# 需要導入模塊: from tornado import http1connection [as 別名]
# 或者: from tornado.http1connection import HTTP1ServerConnection [as 別名]
def initialize(
        self,
        request_callback: Union[
            httputil.HTTPServerConnectionDelegate,
            Callable[[httputil.HTTPServerRequest], None],
        ],
        no_keep_alive: bool = False,
        xheaders: bool = False,
        ssl_options: Union[Dict[str, Any], ssl.SSLContext] = None,
        protocol: str = None,
        decompress_request: bool = False,
        chunk_size: int = None,
        max_header_size: int = None,
        idle_connection_timeout: float = None,
        body_timeout: float = None,
        max_body_size: int = None,
        max_buffer_size: int = None,
        trusted_downstream: List[str] = None,
    ) -> None:
        # This method's signature is not extracted with autodoc
        # because we want its arguments to appear on the class
        # constructor. When changing this signature, also update the
        # copy in httpserver.rst.
        self.request_callback = request_callback
        self.xheaders = xheaders
        self.protocol = protocol
        self.conn_params = HTTP1ConnectionParameters(
            decompress=decompress_request,
            chunk_size=chunk_size,
            max_header_size=max_header_size,
            header_timeout=idle_connection_timeout or 3600,
            max_body_size=max_body_size,
            body_timeout=body_timeout,
            no_keep_alive=no_keep_alive,
        )
        TCPServer.__init__(
            self,
            ssl_options=ssl_options,
            max_buffer_size=max_buffer_size,
            read_chunk_size=chunk_size,
        )
        self._connections = set()  # type: Set[HTTP1ServerConnection]
        self.trusted_downstream = trusted_downstream 
開發者ID:opendevops-cn,項目名稱:opendevops,代碼行數:45,代碼來源:httpserver.py


注:本文中的tornado.http1connection.HTTP1ServerConnection方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。