#region websocket-sharp
public void websocket_sharp() {
try {
var url = "ws://121.40.165.18:8800";
using (var ws = new WebSocketSharp.WebSocket(url)) {
var result = "";
ws.Connect();
ws.OnMessage += (sender, e) =>
result = e.Data;
while (true) {
if (result.Length <= 0) continue;
if (!string.IsNullOrWhiteSpace(result))
Console.WriteLine(result);
result = "";
Thread.Sleep(100);
}
}
} catch (Exception ex) {
Console.WriteLine(ex.Message);
}
}
#endregion