예제 #1
0
 def connectionMade(self):
    WampRawSocketServerProtocol.connectionMade(self)
    ## transport authentication
    ##
    self._authid = None
    self._authrole = None
    self._authmethod = None
예제 #2
0
 def connectionMade(self):
     WampRawSocketServerProtocol.connectionMade(self)
     ## transport authentication
     ##
     self._authid = None
     self._authrole = None
     self._authmethod = None
예제 #3
0
    def test_handshake_succeeds(self):
        """
        A client can connect to a server.
        """
        session_mock = Mock()
        t = FakeTransport()
        f = WampRawSocketClientFactory(lambda: session_mock)
        p = WampRawSocketClientProtocol()
        p.transport = t
        p.factory = f

        server_session_mock = Mock()
        st = FakeTransport()
        sf = WampRawSocketServerFactory(lambda: server_session_mock)
        sp = WampRawSocketServerProtocol()
        sp.transport = st
        sp.factory = sf

        sp.connectionMade()
        p.connectionMade()

        # Send the server the client handshake
        sp.dataReceived(t._written[0:1])
        sp.dataReceived(t._written[1:4])

        # Send the client the server handshake
        p.dataReceived(st._written)

        # The handshake succeeds, a session on each end is created
        # onOpen is called on the session
        session_mock.onOpen.assert_called_once_with(p)
        server_session_mock.onOpen.assert_called_once_with(sp)
    def test_handshake_succeeds(self):
        """
        A client can connect to a server.
        """
        session_mock = Mock()
        t = FakeTransport()
        f = WampRawSocketClientFactory(lambda: session_mock)
        p = WampRawSocketClientProtocol()
        p.transport = t
        p.factory = f

        server_session_mock = Mock()
        st = FakeTransport()
        sf = WampRawSocketServerFactory(lambda: server_session_mock)
        sp = WampRawSocketServerProtocol()
        sp.transport = st
        sp.factory = sf

        sp.connectionMade()
        p.connectionMade()

        # Send the server the client handshake
        sp.dataReceived(t._written[0:1])
        sp.dataReceived(t._written[1:4])

        # Send the client the server handshake
        p.dataReceived(st._written)

        # The handshake succeeds, a session on each end is created
        # onOpen is called on the session
        session_mock.onOpen.assert_called_once_with(p)
        server_session_mock.onOpen.assert_called_once_with(sp)
예제 #5
0
    def connectionMade(self):
        WampRawSocketServerProtocol.connectionMade(self)

        # transport authentication
        #
        self._authid = None
        self._authrole = None
        self._authmethod = None

        # cookie tracking
        #
        self._cbtid = None

        # remember transport level info for later forwarding in
        # WAMP meta event "wamp.session.on_join"
        #
        self._transport_info = {
            'type': 'rawsocket',
            'protocol': None,  # FIXME
            'peer': self.peer
        }
예제 #6
0
    def connectionMade(self):
        WampRawSocketServerProtocol.connectionMade(self)

        ## transport authentication
        ##
        self._authid = None
        self._authrole = None
        self._authmethod = None

        ## cookie tracking
        ##
        self._cbtid = None

        ## remember transport level info for later forwarding in
        ## WAMP metaevent "wamp.metaevent.session.on_join"
        ##
        self._transport_info = {
            'type': 'rawsocket',
            'protocol': None,  # FIXME
            'peer': self.peer
        }