Hello again! I have some doubts regarding the websocket buffer in autobahn. I would appreciate if someone could help me out!
In websocket once there is a new Message it looks like the buffer is cleared out:
def onMessageBegin(self, isBinary): """ Implements :func:`autobahn.websocket.interfaces.IWebSocketChannel.onMessageBegin` """ self.message_is_binary = isBinary self.message_data =  self.message_data_total_length = 0
Does that mean we can only send one Message through the connection and can’t send multiple (say from multiple different functions) messages through that same connection? (client to server)
If my question is not yet clear enough; does that mean we must wait for the message to be processed in the server before sending another one?
Through this logic I mean; we of course understand that the itself nature of websocket stands on processing one message at a time (right?) so if we send multiple messages over the wire they should be processed in order.
However, what if this message needs to be fragmented and it is sent fragmented over the wire, meaning, multiple fragments are sent BUT during this time, say due for asynchronous reasons, another internal function calls the
sendMessage implementation function. In this case as I understand this will result in an overlap with the previous fragmented data and thus the fragmented message will be corrupted in the server, since the original buffer will be cleared out.
Or is it that by the nature of websocket a message that desires to be fragmented must be fragmented and sent immediately (in a synchronous fashion) over the wire? Thus, such corruption will never happen?