Skip to content

WebSocket option to set max outgoing message/frame size #888

@gregerspoulsen

Description

@gregerspoulsen

If you exceed the websocket payload limit when issuing an RPC call in WAMP it drops the connection and fails with 'WAMP transport was lost without closing the session before'. Turning on debug logging shows that it is an 1009 error on the other end, but it took me some time to get there - I think it would be great with a more detailed main error.

That said, in my case at least, I prefer it much to detect the error on the client side to avoid dropping the connection. For now I have solved it by adding the following to autobahn.wamp.websocket.WampWebSocketProtocol.send:

if len(payload) > self.maxFramePayloadSize:
raise ProtocolError(u'Message exceeds payload limit of {0}'.format(self.maxFramePayloadSize))
self.sendMessage(payload, isBinary)

maybe that would be of general interest?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions