mirror of
https://github.com/RaidMax/IW4M-Admin.git
synced 2025-06-17 02:31:16 -05:00
refactor a good bit of stuff for better dependency injection
fix regular expression for T6 log parsing
This commit is contained in:
29
Application/RCon/ConnectionState.cs
Normal file
29
Application/RCon/ConnectionState.cs
Normal file
@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using System.Net.Sockets;
|
||||
using System.Threading;
|
||||
|
||||
namespace IW4MAdmin.Application.RCon
|
||||
{
|
||||
/// <summary>
|
||||
/// used to keep track of the udp connection state
|
||||
/// </summary>
|
||||
internal class ConnectionState
|
||||
{
|
||||
~ConnectionState()
|
||||
{
|
||||
OnComplete.Dispose();
|
||||
OnSentData.Dispose();
|
||||
OnReceivedData.Dispose();
|
||||
}
|
||||
|
||||
public int ConnectionAttempts { get; set; }
|
||||
const int BufferSize = 4096;
|
||||
public readonly byte[] ReceiveBuffer = new byte[BufferSize];
|
||||
public readonly SemaphoreSlim OnComplete = new SemaphoreSlim(1, 1);
|
||||
public readonly ManualResetEventSlim OnSentData = new ManualResetEventSlim(false);
|
||||
public readonly ManualResetEventSlim OnReceivedData = new ManualResetEventSlim(false);
|
||||
public SocketAsyncEventArgs SendEventArgs { get; set; } = new SocketAsyncEventArgs();
|
||||
public SocketAsyncEventArgs ReceiveEventArgs { get; set; } = new SocketAsyncEventArgs();
|
||||
public DateTime LastQuery { get; set; } = DateTime.Now;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user