Example #1
0
 private void SendAsJsonString(object value)
 {
     using (var textWriter = new StringWriter())
     {
         var serializer = new JsonSerializer();
         serializer.Serialize(textWriter, value);
         _webSocket.Send(textWriter.ToString());
     }
 }
        private void SendSubscribeMessage(List <string> tickers)
        {
            var obj = new
            {
                sessionid = _streamSession.SessionId,
                symbols   = tickers,
                filter    = new[] { "trade", "quote" },
                linebreak = true
            };

            var json = JsonConvert.SerializeObject(obj);

            _webSocketClient.Send(json);
        }