예제 #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)