public void OnReceivedSize(ReadOnlyMemory <byte> dataBuffer) { this.bodySize = 0; for (int i = 0; i < this.SizeLength; ++i) { int offset = 0; if (this.SizeBufferEndian == ECNBufferEndian.Big) { offset = 8 * (this.SizeLength - i - 1); } else { offset = 8 * i; } this.bodySize |= (uint)(dataBuffer.Span[i] << offset); } this.receiveMode = EReceiveMode.Body; }
public void Initialize() { this.bufferForSend.SetBufferSize(1024); this.receiveMode = EReceiveMode.Size; this.bodySize = 0; }
public void OnReceivedBody(ReadOnlyMemory <byte> dataBuffer) { this.bodySize = 0; this.receiveMode = EReceiveMode.Size; }