Pat
❔ Reading from ClientWebSocket with BinaryReader
I am building an app to work as a gateway between a consumer connecting to a .NET websocket server and then proxying that to a TCP backend server. This code currently works quite well for TCP clients and makes use of the BinaryReader / BinaryWriter to proxy between the WebSocket and the TCPClient classes.
I'm trying to replicate the same behavior between a ClientWebSocket and a Websocket but can't seem to find a solution to reading each "packet" the binary ClientWebSocket receives. Wireshark shows the data I would expect but calling ClientWebSocket.ReceiveAsync results in odd counts that do not match the packets.
I'm trying to replicate the same behavior between a ClientWebSocket and a Websocket but can't seem to find a solution to reading each "packet" the binary ClientWebSocket receives. Wireshark shows the data I would expect but calling ClientWebSocket.ReceiveAsync results in odd counts that do not match the packets.
3 replies