public void SendRequest(RequestWrapper msg, Action <ReplyWrapper> callback)
        {
            Profiler.BeginSample("Bentley.BackendRouter.SendRequest");

            unchecked { ++_callbackCounter; } // wrap is fine
            _callbackMap[_callbackCounter] = callback;
            msg.RequestId = _callbackCounter;

            int msgSize = msg.CalculateSize();

            if (msgSize > _requestMsgBuffer.Length)
            {
                _requestMsgBuffer = new byte[Math.Max(msgSize, _requestMsgBuffer.Length * 2)];
            }

            var stream = new CodedOutputStream(_requestMsgBuffer); // Can't reuse CodedOutputStream :(

            msg.WriteTo(stream);
            _webSocket.Send(_requestMsgBuffer, 0, msgSize);

            Profiler.EndSample();
        }