WebSocketServerProtocol question

#1

I want to remove a server side database value for clients in the onClose method of my class that subclasses WebSocketServerProtocol. How can I get access to the the address:port string from within onClose? I know I can acquire this information from within onConnect because it is passed a ConnectionRequest object which has the attribute peerstr.

Thanks!

0 Likes

#2

You can access those via self.peer and self.peerstr

https://github.com/tavendo/AutobahnPython/blob/master/autobahn/autobahn/websocket.py#L977

···

On May 10, 3:56 am, Isaac G <hyper...@gmail.com> wrote:

I want to remove a server side database value for clients in the onClose
method of my class that subclasses WebSocketServerProtocol. How can I get
access to the the address:port string from within `onClose`? I know I can
acquire this information from within `onConnect` because it is passed a
`ConnectionRequest` object which has the attribute `peerstr`.

Thanks!

0 Likes

#3

Awesome! Thanks Tobias!

···

On Saturday, May 19, 2012 7:16:24 AM UTC-4, Tobias Oberstein wrote:

You can access those via self.peer and self.peerstr

https://github.com/tavendo/AutobahnPython/blob/master/autobahn/autobahn/websocket.py#L977

On May 10, 3:56 am, Isaac G hyper...@gmail.com wrote:

I want to remove a server side database value for clients in the onClose

method of my class that subclasses WebSocketServerProtocol. How can I get

access to the the address:port string from within onClose? I know I can

acquire this information from within onConnect because it is passed a

ConnectionRequest object which has the attribute peerstr.

Thanks!

0 Likes