You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 8, 2021. It is now read-only.
var endpoint = new IPEndPoint(IPAddress.Loopback, 6002);
using (var client = new TcpClient()) {
client.ProtocolFactory = WebSocketClientFactory.Default;
client.Open(endpoint);
var dataLength = 4096;
var bytes = new byte[dataLength];
var resp = (string)client.ExecuteSync(bytes);
WriteLine($"{DateTime.Now:HH:mm:ss fff}\t{resp}");
}
I think there must be something wrong in method: BufferStream.Write(byte[] buffer, int bufferOffset, int count).
int origCount = count;
CheckDisposed();
if(isReadOnly) throw new NotSupportedException();
int newEnd = checked((offset - origin) + count);
if (newEnd > length)
{
Grow(newEnd);
length = newEnd;
}
int chunkIndex = offset/NetContext.BufferSize, chunkOffet = offset%NetContext.BufferSize;
int thisPage = NetContext.BufferSize - chunkOffet;
var chunk = buffers[chunkIndex]; // will throw ArgumentOutOfRangeException if the buffer.Length == 4096
if (thisPage >= count)
{
// can write to a single page
Buffer.BlockCopy(buffer, bufferOffset, chunk, chunkOffet, count);
}