Wamp + Asyncio + Python3.3 client: TCP connection dropping

#1

Hi!

First of all, I’m a beginner about wbsocket and wamp.

My situation: there is a working ratchet-wamp php server, I want to make a python client subscribing to a topic of the server. I follow the example on https://github.com/tavendo/AutobahnPython/blob/master/examples/asyncio/wamp/beginner/client.py but the tcp connection drop.

Below the result, any suggestion?

Thanks!

···

[(‘debug’, True, ‘WampWebSocketClientFactory’),
(‘debugCodePaths’, False, ‘WampWebSocketClientFactory’),
(‘logOctets’, True, ‘WampWebSocketClientFactory’),
(‘logFrames’, True, ‘WampWebSocketClientFactory’),
(‘trackTimings’, False, ‘WampWebSocketClientFactory’),
(‘allowHixie76’, False, ‘WampWebSocketClientFactory’),
(‘utf8validateIncoming’, True, ‘WampWebSocketClientFactory’),
(‘applyMask’, True, ‘WampWebSocketClientFactory’),
(‘maxFramePayloadSize’, 0, ‘WampWebSocketClientFactory’),
(‘maxMessagePayloadSize’, 0, ‘WampWebSocketClientFactory’),
(‘autoFragmentSize’, 0, ‘WampWebSocketClientFactory’),
(‘failByDrop’, True, ‘WampWebSocketClientFactory’),
(‘echoCloseCodeReason’, False, ‘WampWebSocketClientFactory’),
(‘openHandshakeTimeout’, 5, ‘WampWebSocketClientFactory’),
(‘closeHandshakeTimeout’, 1, ‘WampWebSocketClientFactory’),
(‘tcpNoDelay’, True, ‘WampWebSocketClientFactory’),
(‘autoPingInterval’, 0, ‘WampWebSocketClientFactory’),
(‘autoPingTimeout’, 0, ‘WampWebSocketClientFactory’),
(‘autoPingSize’, 4, ‘WampWebSocketClientFactory’),
(‘version’, 18, ‘WampWebSocketClientFactory’),
(‘acceptMaskedServerFrames’, False, ‘WampWebSocketClientFactory’),
(‘maskClientFrames’, True, ‘WampWebSocketClientFactory’),
(‘serverConnectionDropTimeout’, 1, ‘WampWebSocketClientFactory’),
(‘perMessageCompressionOffers’, [], ‘WampWebSocketClientFactory’),
(‘perMessageCompressionAccept’,
<function WebSocketClientFactory.resetProtocolOptions.. at 0x000000000319E9D8>,
‘WampWebSocketClientFactory’)]
connection to 192.168.100.218:44444 established
TX Octets to 192.168.100.218:44444 : sync = False, octets = b’474554202f20485454502f312e310d0a557365722d4167656e743a204175746f6261686e507974686f6e2f302e392e310d0a486f73743a206c6f63616c686f73743a38300d0a557067726164653a20576562536f636b65740d0a436f6e6e656374696f6e3a20557067726164650d0a507261676d613a206e6f2d63616368650d0a43616368652d436f6e74726f6c3a206e6f2d63616368650d0a5365632d576562536f636b65742d4b65793a2075544d2b464a59516349546f344d68645070796b47673d3d0d0a5365632d576562536f636b65742d50726f746f636f6c3a2077616d702e322e6a736f6e2e626174636865642c77616d702e322e6a736f6e0d0a5365632d576562536f636b65742d56657273696f6e3a2031330d0a0d0a’
GET / HTTP/1.1
User-Agent: AutobahnPython/0.9.1
Host: localhost:80
Upgrade: WebSocket
Connection: Upgrade
Pragma: no-cache
Cache-Control: no-cache
Sec-WebSocket-Key: uTM+FJYQcITo4MhdPpykGg==
Sec-WebSocket-Protocol: wamp.2.json.batched,wamp.2.json
Sec-WebSocket-Version: 13

RX Octets from 192.168.100.218:44444 : octets = b’485454502f312e312031303120537769746368696e672050726f746f636f6c730d0a557067726164653a20776562736f636b65740d0a436f6e6e656374696f6e3a20557067726164650d0a5365632d576562536f636b65742d4163636570743a20656f506f376a507a706d5a796a2f34737351536f7645356c3168493d0d0a582d506f77657265642d42793a20526174636865742f302e322e370d0a0d0a81265b302c2235343239333139396437333764222c312c22526174636865745c2f302e322e37225d’
received HTTP response:
b’HTTP/1.1 101 Switching Protocols\r\nUpgrade: websocket\r\nConnection: Upgrade\r\nSec-WebSocket-Accept: eoPo7jPzpmZyj/4ssQSovE5l1hI=\r\nX-Powered-By: Ratchet/0.2.7\r\n\r\n’

received HTTP status line in opening handshake : HTTP/1.1 101 Switching Protocols
received HTTP headers in opening handshake : {‘connection’: ‘Upgrade’, ‘upgrade’: ‘websocket’, ‘x-powered-by’: ‘Ratchet/0.2.7’, ‘sec-websocket-accept’: ‘eoPo7jPzpmZyj/4ssQSovE5l1hI=’}
WAMP-over-WebSocket transport lost: wasClean = False, code = 1006, reason = ‘connection was closed uncleanly (I failed the WebSocket connection by dropping the TCP connection)’
Traceback (most recent call last):
File “C:\Python33\lib\site-packages\autobahn-0.9.1-py3.3.egg\autobahn\wamp\websocket.py”, line 75, in onClose
self._session.onClose(wasClean)
AttributeError: ‘WampWebSocketClientProtocol’ object has no attribute ‘_session’
connection to 192.168.100.218:44444 lost

0 Likes