def dataReceived(self, data):
self.stompBuffer.appendData(data)<EOL>while True:<EOL><INDENT>msg = self.stompBuffer.getOneMessage()<EOL>if msg is None:<EOL><INDENT>break<EOL><DEDENT>returned = self.sm.react(msg)<EOL>if returned:<EOL><INDENT>self.transport.write(returned)<EOL><DEDENT><DEDENT>
Use stompbuffer to determine when a complete message has been received.