当前位置: 首页>>代码示例>>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;未经允许,请勿转载。