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


Python ssl.Port方法代码示例

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


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

示例1: adoptStreamPort

# 需要导入模块: from twisted.internet import ssl [as 别名]
# 或者: from twisted.internet.ssl import Port [as 别名]
def adoptStreamPort(self, fileDescriptor, addressFamily, factory):
        """
        Create a new L{IListeningPort} from an already-initialized socket.

        This just dispatches to a suitable port implementation (eg from
        L{IReactorTCP}, etc) based on the specified C{addressFamily}.

        @see: L{twisted.internet.interfaces.IReactorSocket.adoptStreamPort}
        """
        if addressFamily not in (socket.AF_INET, socket.AF_INET6):
            raise error.UnsupportedAddressFamily(addressFamily)

        p = tcp.Port._fromListeningDescriptor(
            self, fileDescriptor, addressFamily, factory)
        p.startListening()
        return p 
开发者ID:proxysh,项目名称:Safejumper-for-Desktop,代码行数:18,代码来源:posixbase.py

示例2: adoptStreamPort

# 需要导入模块: from twisted.internet import ssl [as 别名]
# 或者: from twisted.internet.ssl import Port [as 别名]
def adoptStreamPort(self, fileDescriptor, addressFamily, factory):
        """
        Create a new L{IListeningPort} from an already-initialized socket.

        This just dispatches to a suitable port implementation (eg from
        L{IReactorTCP}, etc) based on the specified C{addressFamily}.

        @see: L{twisted.internet.interfaces.IReactorSocket.adoptStreamPort}
        """
        if addressFamily not in self._supportedAddressFamilies:
            raise error.UnsupportedAddressFamily(addressFamily)

        if unixEnabled and addressFamily == socket.AF_UNIX:
            p = unix.Port._fromListeningDescriptor(
                self, fileDescriptor, factory)
        else:
            p = tcp.Port._fromListeningDescriptor(
                self, fileDescriptor, addressFamily, factory)
        p.startListening()
        return p 
开发者ID:wistbean,项目名称:learn_python3_spider,代码行数:22,代码来源:posixbase.py

示例3: listenUDP

# 需要导入模块: from twisted.internet import ssl [as 别名]
# 或者: from twisted.internet.ssl import Port [as 别名]
def listenUDP(self, port, protocol, interface='', maxPacketSize=8192):
        """Connects a given L{DatagramProtocol} to the given numeric UDP port.

        @returns: object conforming to L{IListeningPort}.
        """
        p = udp.Port(port, protocol, interface, maxPacketSize, self)
        p.startListening()
        return p

    # IReactorMulticast 
开发者ID:proxysh,项目名称:Safejumper-for-Desktop,代码行数:12,代码来源:posixbase.py

示例4: listenUNIX

# 需要导入模块: from twisted.internet import ssl [as 别名]
# 或者: from twisted.internet.ssl import Port [as 别名]
def listenUNIX(self, address, factory, backlog=50, mode=0o666, wantPID=0):
        assert unixEnabled, "UNIX support is not present"
        p = unix.Port(address, factory, backlog, mode, self, wantPID)
        p.startListening()
        return p


    # IReactorUNIXDatagram 
开发者ID:proxysh,项目名称:Safejumper-for-Desktop,代码行数:10,代码来源:posixbase.py

示例5: adoptDatagramPort

# 需要导入模块: from twisted.internet import ssl [as 别名]
# 或者: from twisted.internet.ssl import Port [as 别名]
def adoptDatagramPort(self, fileDescriptor, addressFamily, protocol,
                          maxPacketSize=8192):
        if addressFamily not in (socket.AF_INET, socket.AF_INET6):
            raise error.UnsupportedAddressFamily(addressFamily)

        p = udp.Port._fromListeningDescriptor(
            self, fileDescriptor, addressFamily, protocol,
            maxPacketSize=maxPacketSize)
        p.startListening()
        return p



    # IReactorTCP 
开发者ID:proxysh,项目名称:Safejumper-for-Desktop,代码行数:16,代码来源:posixbase.py

示例6: listenTCP

# 需要导入模块: from twisted.internet import ssl [as 别名]
# 或者: from twisted.internet.ssl import Port [as 别名]
def listenTCP(self, port, factory, backlog=50, interface=''):
        p = tcp.Port(port, factory, backlog, interface, self)
        p.startListening()
        return p 
开发者ID:proxysh,项目名称:Safejumper-for-Desktop,代码行数:6,代码来源:posixbase.py

示例7: doRead

# 需要导入模块: from twisted.internet import ssl [as 别名]
# 或者: from twisted.internet.ssl import Port [as 别名]
def doRead(self):
        self.numberAccepts = min(
            self.factory.maxRequests - self.factory.outstandingRequests,
            self.factory.maxAccepts
        )
        tcp.Port.doRead(self) 
开发者ID:apple,项目名称:ccs-twistedextensions,代码行数:8,代码来源:tcp.py

示例8: __init__

# 需要导入模块: from twisted.internet import ssl [as 别名]
# 或者: from twisted.internet.ssl import Port [as 别名]
def __init__(self, fd, factory, reactor):
        tcp.Port.__init__(self, 0, factory, reactor=reactor)
        # MOR: careful because fromfd dup()'s the socket, so we need to
        # make sure we don't leak file descriptors
        self.socket = socket.fromfd(fd, socket.AF_INET, socket.SOCK_STREAM)
        self._realPortNumber = self.port = self.socket.getsockname()[1] 
开发者ID:apple,项目名称:ccs-twistedextensions,代码行数:8,代码来源:tcp.py

示例9: _preMakeConnection

# 需要导入模块: from twisted.internet import ssl [as 别名]
# 或者: from twisted.internet.ssl import Port [as 别名]
def _preMakeConnection(self, transport):
        transport._startTLS()
        return tcp.Port._preMakeConnection(self, transport) 
开发者ID:apple,项目名称:ccs-twistedextensions,代码行数:5,代码来源:tcp.py

示例10: listenTCP

# 需要导入模块: from twisted.internet import ssl [as 别名]
# 或者: from twisted.internet.ssl import Port [as 别名]
def listenTCP(self, port, factory, backlog=50, interface=''):
        """@see: twisted.internet.interfaces.IReactorTCP.listenTCP
        """
        p = tcp.Port(port, factory, backlog, interface, self)
        p.startListening()
        return p 
开发者ID:kuri65536,项目名称:python-for-android,代码行数:8,代码来源:posixbase.py

示例11: listenSSL

# 需要导入模块: from twisted.internet import ssl [as 别名]
# 或者: from twisted.internet.ssl import Port [as 别名]
def listenSSL(self, port, factory, contextFactory, backlog=50, interface=''):
        """@see: twisted.internet.interfaces.IReactorSSL.listenSSL
        """
        assert sslEnabled, "SSL support is not present"
        p = ssl.Port(port, factory, contextFactory, backlog, interface, self)
        p.startListening()
        return p


    # IReactorArbitrary 
开发者ID:kuri65536,项目名称:python-for-android,代码行数:12,代码来源:posixbase.py

示例12: listenUDP

# 需要导入模块: from twisted.internet import ssl [as 别名]
# 或者: from twisted.internet.ssl import Port [as 别名]
def listenUDP(self, port, protocol, interface='', maxPacketSize=8192):
        """Connects a given L{DatagramProtocol} to the given numeric UDP port.

        @returns: object conforming to L{IListeningPort}.
        """
        p = udp.Port(port, protocol, interface, maxPacketSize, self)
        p.startListening()
        return p 
开发者ID:kenorb-contrib,项目名称:BitTorrent,代码行数:10,代码来源:posixbase.py

示例13: listenSSL

# 需要导入模块: from twisted.internet import ssl [as 别名]
# 或者: from twisted.internet.ssl import Port [as 别名]
def listenSSL(self, port, factory, contextFactory, backlog=50, interface=''):
        """@see: twisted.internet.interfaces.IReactorSSL.listenSSL
        """
        assert sslEnabled, "SSL support is not present"
        p = ssl.Port(port, factory, contextFactory, backlog, interface, self)
        p.startListening()
        return p

    # IReactorArbitrary 
开发者ID:kenorb-contrib,项目名称:BitTorrent,代码行数:11,代码来源:posixbase.py


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