コード例 #1
0
    def write(self, data):
        # stomp broker ==> websocket
        # Sending a stomp frame per websocket frame
    
        if len(self._buffer):
            data = self._buffer + data
            self._buffer = ''

        # waiting for a complete stomp frame
        if not data.endswith(self.STOMP_FRAME_SEPARATOR):
            self._buffer += data
            return 
        
        # spliting multiples frames
        WebSocketWrapperProtocol.writeSequence(self, 
                            data.split(self.STOMP_FRAME_SEPARATOR))