示例#1
0
文件: unix.py 项目: ixokai/pants
    def __init__(self, ConnectionClass=None):
        StreamServer.__init__(self, family=socket.AF_UNIX)

        # Sets instance attribute, NOT class attribute.
        if ConnectionClass:
            self.ConnectionClass = ConnectionClass

        self.channels = weakref.WeakValueDictionary()  # fd : channel
示例#2
0
文件: unix.py 项目: ixokai/pants
    def listen(self, addr, backlog=1024):
        """
        Begin listening for connections made to the channel.

        Returns the channel.

        ==========  ============
        Arguments   Description
        ==========  ============
        addr        The address to listen on.
        backlog     *Optional.* The size of the connection queue. By default, is 1024.
        ==========  ============
        """
        return StreamServer.listen(self, addr, backlog)
示例#3
0
文件: network.py 项目: ixokai/pants
    def listen(self, port=8080, host='', backlog=1024):
        """
        Begin listening for connections made to the channel.

        Returns the channel.

        ==========  ============
        Arguments   Description
        ==========  ============
        port        *Optional.* The port to listen for connection on. By default, is 8080.
        host        *Optional.* The local host to bind to. By default, is ''.
        backlog     *Optional.* The size of the connection queue. By default, is 1024.
        ==========  ============
        """
        return StreamServer.listen(self, (host, port), backlog)