Beispiel #1
0
        public async Task Start(WSClientData data)
        {
            _ws = new ClientWebSocket();

            var buf = new byte[data.CalculateSize()];
            var st  = new CodedOutputStream(buf);

            data.WriteTo(st);

            var hdr = System.Convert.ToBase64String(buf);

            _ws.Options.SetRequestHeader("WSDATA", hdr);

            await _ws.ConnectAsync(_uri, CancellationToken.None);

            _connectToken   = new CancellationTokenSource();
            _wsTaskConnnect = Task.Run(CreateConnection);
        }
Beispiel #2
0
        public void SendUserConnected(WSClientData clientData)
        {
            var msg = new PushIntanceSyncMessage();

            _topic.Send(msg.ToByteArray());
        }