Drop session

#1

Hello all!!
How to I can disconnect client session by wamp session ID?

Sorry for my English.

0 Likes

#2

I found “wamp.session.kill” procedure. I try call this in Python and got error:

yield self.call( “wamp.session.kill”, session_id=cl_details.caller, reason=“com.example.error.locked”, message=“ID: %s-%s” % (userid, objid) )

ERROR:

2015-09-15 10:28:30+0300 [Router 10584] File “local/lib/python2.7/site-packages/twisted/internet/defer.py”, line 150, in maybeDeferred

2015-09-15 10:28:30+0300 [Router 10584] result = f(*args, **kw)

2015-09-15 10:28:30+0300 [Router 10584] File “local/lib/python2.7/site-packages/crossbar/router/service.py”, line 144, in session_kill

2015-09-15 10:28:30+0300 [Router 10584] session.leave(reason=reason, message=message)

2015-09-15 10:28:30+0300 [Router 10584] File “local/lib/python2.7/site-packages/crossbar/router/session.py”, line 409, in leave

2015-09-15 10:28:30+0300 [Router 10584] msg = wamp.message.Goodbye(reason, message)

2015-09-15 10:28:30+0300 [Router 10584] File “local/lib/python2.7/site-packages/autobahn/wamp/message.py”, line 718, in init

2015-09-15 10:28:30+0300 [Router 10584] assert(type(reason) == six.text_type)

2015-09-15 10:28:30+0300 [Router 10584] exceptions.AssertionError:

2015-09-15 10:28:30+0300 [Router 10584] ‘Failure while invoking procedure registered under “wamp.session.kill”.’

2015-09-15 10:28:30+0300 [Router 10584] Unhandled Error

2015-09-15 10:28:30+0300 [Router 10584] Traceback (most recent call last):

2015-09-15 10:28:30+0300 [Router 10584] Failure: autobahn.wamp.exception.ApplicationError: ApplicationError(‘wamp.error.runtime_error’, args = (), kwargs = {})

0 Likes

#3

2015-09-15 10:28:30+0300 [Router 10584] assert(type(reason) ==
six.text_type)

Your reason is of type bytes, not Unicode.

0 Likes

#4

Thanks you! When I added u"…" all work.

···

вторник, 15 сентября 2015 г., 11:13:39 UTC+3 пользователь Tobias Oberstein написал:

2015-09-15 10:28:30+0300 [Router 10584] assert(type(reason) ==

six.text_type)

Your reason is of type bytes, not Unicode.

0 Likes