Ejemplo n.º 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))
Ejemplo n.º 2
0
 def dataReceived(self, data):
     # websocket ==> stompbroker
     WebSocketWrapperProtocol.dataReceived(self, data)
Ejemplo n.º 3
0
 def __init__(self, *args, **kwargs):
     print "Using stomp fixer"
     WebSocketWrapperProtocol.__init__(self, *args, **kwargs)
     self._buffer = ''