public async Task Start(string listenKey)
        {
            var uri = new StringBuilder(128);

            var baseAddress = ConfigurationManager.AppSettings["WebSocketsBaseAddress"];

            uri.Append(baseAddress).Append("/ws/").Append(listenKey);

            await _webSocket.Connect(uri.ToString());

            _webSocket.OnMessage(OnMessageArrives);
        }
Example #2
0
        public async Task Start()
        {
            var uri = new StringBuilder(256);

            var baseAddress = ConfigurationManager.AppSettings["WebSocketsBaseAddress"];

            uri.Append(baseAddress).Append("/stream?streams=");

            foreach (var listener in _listeners)
            {
                uri.Append(listener.EventUri).Append("/");
            }

            await _webSocket.Connect(uri.ToString().TrimEnd('/'));

            _webSocket.OnMessage(OnMessageArrives);
        }