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


Python socket.SO_OOBINLINE屬性代碼示例

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


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

示例1: handle_expt

# 需要導入模塊: import socket [as 別名]
# 或者: from socket import SO_OOBINLINE [as 別名]
def handle_expt(self):
        """Called when there is out of band (OOB) data to be read.
        This might happen in case of such clients strictly following
        the RFC-959 directives of sending Telnet IP and Synch as OOB
        data before issuing ABOR, STAT and QUIT commands.
        It should never be called since the SO_OOBINLINE option is
        enabled except on some systems like FreeBSD where it doesn't
        seem to have effect.
        """
        if hasattr(socket, 'MSG_OOB'):
            try:
                data = self.socket.recv(1024, socket.MSG_OOB)
            except socket.error, err:
                if err.args[0] == errno.EINVAL:
                    return
            else:
                self._in_buffer.append(data)
                return 
開發者ID:exasol,項目名稱:script-languages,代碼行數:20,代碼來源:ftpserver.py

示例2: testSO_KEEPALIVE

# 需要導入模塊: import socket [as 別名]
# 或者: from socket import SO_OOBINLINE [as 別名]
def testSO_KEEPALIVE(self):
        self.test_tcp_client = 1
        self.test_tcp_server = 1
        self._testOption(socket.SOL_SOCKET, socket.SO_KEEPALIVE, [0, 1])
        self._testInheritedOption(socket.SOL_SOCKET, socket.SO_KEEPALIVE, [0, 1])

    # def testSO_LINGER(self):
    #     self.test_tcp_client = 1
    #     self.test_tcp_server = 1
    #     off = struct.pack('ii', 0, 0)
    #     on_2_seconds = struct.pack('ii', 1, 2)
    #     self._testOption(socket.SOL_SOCKET, socket.SO_LINGER, [off, on_2_seconds])
    #     self._testInheritedOption(socket.SOL_SOCKET, socket.SO_LINGER, [off, on_2_seconds])

    # # WILL NOT FIX
    # def testSO_OOBINLINE(self):
    #     self.test_tcp_client = 1
    #     self.test_tcp_server = 1
    #     self._testOption(socket.SOL_SOCKET, socket.SO_OOBINLINE, [0, 1])
    #     self._testInheritedOption(socket.SOL_SOCKET, socket.SO_OOBINLINE, [0, 1]) 
開發者ID:Acmesec,項目名稱:CTFCrackTools-V2,代碼行數:22,代碼來源:test_socket.py

示例3: __init__

# 需要導入模塊: import socket [as 別名]
# 或者: from socket import SO_OOBINLINE [as 別名]
def __init__(self, conn):
        asynchat.async_chat.__init__(self, conn)
        # tells the socket to handle urgent data inline (ABOR command)
        self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_OOBINLINE, 1)
        self.set_terminator(b"\r\n")
        self.in_buffer = []
        self.dtp = None
        self.last_received_cmd = None
        self.last_received_data = ''
        self.next_response = ''
        self.next_data = None
        self.rest = None
        self.next_retr_data = RETR_DATA
        self.push('220 welcome') 
開發者ID:Microvellum,項目名稱:Fluid-Designer,代碼行數:16,代碼來源:test_ftplib.py

示例4: testSO_OOBINLINE

# 需要導入模塊: import socket [as 別名]
# 或者: from socket import SO_OOBINLINE [as 別名]
def testSO_OOBINLINE(self):
        self.test_tcp_client = 1
        self._testOption(socket.SOL_SOCKET, socket.SO_OOBINLINE, [0, 1]) 
開發者ID:ofermend,項目名稱:medicare-demo,代碼行數:5,代碼來源:test_socket.py


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