handleIncomingMessage method
Call with every incoming message. Returns true if the message was an ACK
(it should not be forwarded to the user in that case).
Implementation
bool handleIncomingMessage(WebSocketMessage message) {
final data = message.data;
if (data is! Map) return false;
final ackId = data[_kAckResponseKey];
if (ackId is! String) return false;
final pending = _pending.remove(ackId);
if (pending == null) return false;
_log('ACK received for $ackId');
pending.complete();
return true;
}