예제 #1
0
파일: client.py 프로젝트: PHPDOTSQL/rce
    def __init__(self, receiver, userID, robotID, password, reactor):
        """ Initialize the Connection.

            @param receiver:    Object which is responsible for the processing
                                of received data messages.
            @type  receiver:    rce.comm.interfaces.IMessageReceiver

            @param userID:      User ID which will be used to authenticate the
                                connection.
            @type  userID:      str

            @param robotID:     Robot ID which will be used to authenticate the
                                connection.
            @type  robotID:     str

            @param password:    Password which will be used to authenticate the
                                connection.
            @type  password:    str

            @param reactor:     Reference to reactor which is used for this
                                connection.
            @type  reactor:     twisted::reactor
        """
        verifyObject(IMessageReceiver, receiver)

        self._receiver = receiver
        self._userID = userID
        self._robotID = robotID
        self._password = sha256(password).hexdigest()
        self._reactor = reactor
        self._conn = None
        self._connectedDeferred = None
예제 #2
0
    def __init__(self, receiver, userID, robotID, password, reactor):
        """ Initialize the Connection.

            @param receiver:    Object which is responsible for the processing
                                of received data messages.
            @type  receiver:    rce.comm.interfaces.IMessageReceiver

            @param userID:      User ID which will be used to authenticate the
                                connection.
            @type  userID:      str

            @param robotID:     Robot ID which will be used to authenticate the
                                connection.
            @type  robotID:     str

            @param password:    Password which will be used to authenticate the
                                connection.
            @type  password:    str

            @param reactor:     Reference to reactor which is used for this
                                connection.
            @type  reactor:     twisted::reactor
        """
        verifyObject(IClient, receiver)

        self._receiver = receiver
        self._userID = userID
        self._robotID = robotID
        self._password = sha256(password).hexdigest()
        self._reactor = reactor
        self._conn = None
        self._connectedDeferred = None
예제 #3
0
파일: robot.py 프로젝트: micpalmia/rce
    def registerProtocol(self, protocol):
        """ Register the client protocol.

            @param protocol:    Protocol which should be registered.
            @type  protocol:    rce.comm.interfaces.IServersideProtocol
        """
        assert self._protocol is None
        verifyObject(IProtocol, protocol)
        self._protocol = protocol
예제 #4
0
    def registerProtocol(self, protocol):
        """ Register the client protocol.

            @param protocol:    Protocol which should be registered.
            @type  protocol:    rce.comm.interfaces.IServersideProtocol
        """
        assert self._protocol is None
        verifyObject(IProtocol, protocol)
        self._protocol = protocol
예제 #5
0
파일: server.py 프로젝트: vmayoral/rce
    def _authenticate_success(self, avatar):
        """ Method is called by deferred when the connection has been
            successfully authenticated while being in 'onConnect'.
        """
        verifyObject(IRobot, avatar)
        verifyObject(IMessageReceiver, avatar)

        self._realm.registerWebsocketProtocol(avatar, self)
        self._avatar = avatar
        self._assembler.start()
예제 #6
0
    def _authenticate_success(self, avatar):
        """ Method is called by deferred when the connection has been
            successfully authenticated while being in 'onConnect'.
        """
        verifyObject(IRobot, avatar)
        verifyObject(IMessageReceiver, avatar)

        self._realm.registerWebsocketProtocol(avatar, self)
        self._avatar = avatar
        self._assembler.start()
예제 #7
0
파일: server.py 프로젝트: vmayoral/rce
    def __init__(self, realm):
        """ Initialize the Robot resource.

            @param realm:       Master realm implementing necessary callback
                                methods.
            @type  realm:       rce.comm.interfaces.IMasterRealm
        """
        Resource.__init__(self)

        verifyObject(IMasterRealm, realm)
        self._realm = realm
예제 #8
0
    def __init__(self, realm):
        """ Initialize the Robot resource.

            @param realm:       Master realm implementing necessary callback
                                methods.
            @type  realm:       rce.comm.interfaces.IMasterRealm
        """
        Resource.__init__(self)

        verifyObject(IMasterRealm, realm)
        self._realm = realm
예제 #9
0
파일: server.py 프로젝트: vmayoral/rce
    def __init__(self, realm):
        """ Initialize the Protocol.

            @param realm:       Robot realm implementing necessary callback
                                methods.
            @type  realm:       rce.comm.interfaces.IRobotRealm
        """
        verifyObject(IRobotRealm, realm)

        self._realm = realm
        self._assembler = MessageAssembler(self, self.MSG_QUEUE_TIMEOUT)
        self._avatar = None
예제 #10
0
    def __init__(self, realm):
        """ Initialize the Protocol.

            @param realm:       Robot realm implementing necessary callback
                                methods.
            @type  realm:       rce.comm.interfaces.IRobotRealm
        """
        verifyObject(IRobotRealm, realm)

        self._realm = realm
        self._assembler = MessageAssembler(self, self.MSG_QUEUE_TIMEOUT)
        self._avatar = None