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
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
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
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()
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
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