increase buffer size for rcon connection
This commit is contained in:
parent
28373b9325
commit
dd3ebf6b34
@ -18,7 +18,7 @@ namespace IW4MAdmin.Application.RCon
|
||||
}
|
||||
|
||||
public int ConnectionAttempts { get; set; }
|
||||
const int BufferSize = 8192;
|
||||
private const int BufferSize = 16384;
|
||||
public readonly byte[] ReceiveBuffer = new byte[BufferSize];
|
||||
public readonly SemaphoreSlim OnComplete = new SemaphoreSlim(1, 1);
|
||||
public readonly ManualResetEventSlim OnSentData = new ManualResetEventSlim(false);
|
||||
|
@ -430,6 +430,13 @@ namespace IW4MAdmin.Application.RCon
|
||||
while (sock.Available > 0)
|
||||
{
|
||||
_log.LogDebug("{available} more bytes to be read", sock.Available);
|
||||
|
||||
var bufferSpaceAvailable = sock.Available + totalBytesTransferred - state.ReceiveBuffer.Length;
|
||||
if (bufferSpaceAvailable >= 0 )
|
||||
{
|
||||
_log.LogWarning("Not enough buffer space to store incoming data {bytesNeeded} additional bytes required", bufferSpaceAvailable);
|
||||
}
|
||||
|
||||
state.ReceiveEventArgs.SetBuffer(state.ReceiveBuffer, totalBytesTransferred, sock.Available);
|
||||
|
||||
if (sock.ReceiveAsync(state.ReceiveEventArgs))
|
||||
|
Loading…
Reference in New Issue
Block a user