def connectionMade(self): WampRawSocketServerProtocol.connectionMade(self) ## transport authentication ## self._authid = None self._authrole = None self._authmethod = None
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 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 }
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 }