Example #1
0
 private void HeartbeatTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
 {
     try
     {
         _ws?.Send("");
     }
     catch (Exception ex)
     {
         _logger.LogException(ex);
     }
 }
        private void Ws_Opened(object sender, EventArgs e)
        {
            var s = "{\"type\":\"startWatching\",\"data\":{\"stream\":{\"quality\":\"abr\",\"protocol\":\"hls\",\"latency\":\"low\",\"chasePlay\":false},\"room\":{\"protocol\":\"webSocket\",\"commentable\":true},\"reconnect\":false}}";

            try
            {
                _ws.Send(s);
            }
            catch (Exception ex)
            {
            }
        }
Example #3
0
 // We only support anonymous mode now.
 private void SendAuthMessage()
 {
     _websocket.Send(
         "{" +
         "\"type\": \"method\"," +
         "\"method\": \"auth\"," +
         "\"arguments\": [" +
         _channelID + "," +
         "   0," +
         "\"" + _authKey + "\"" +
         "]," +
         "\"id\": 0" +
         "}"
         );
 }
Example #4
0
 public void SendPing()
 {
     _ws?.Send("");
 }
 public override void Send(string data) => Websocket.Send(data);
 public void Send(string message)
 {
     _ws?.Send(message);
 }