This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Diagnostics; | |
using System.Net.WebSockets; | |
using System.Text; | |
var socket = new ClientWebSocket(); | |
socket.Options.KeepAliveInterval = TimeSpan.FromSeconds(15); | |
socket.Options.SetBuffer(65536, 65536); // Setting it to anything bigger than 65536 throws an exception in .net framework | |
await socket.ConnectAsync(new Uri("wss://stream.binance.com:9443/stream"), default); | |
var readThread = new Thread(async () => |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Diagnostics; | |
using System.Net.WebSockets; | |
using System.Text; | |
var socket = new ClientWebSocket(); | |
socket.Options.KeepAliveInterval = TimeSpan.FromSeconds(1); | |
socket.Options.SetBuffer(65536, 65536); | |
await socket.ConnectAsync(new Uri("wss://stream.bybit.com/spot/quote/ws/v2"), default); | |
var readThread = new Thread(async () => |