public ProudSession(uint hostId, IChannel channel, ProudServer server) { HostId = hostId; Server = server; Channel = (ISocketChannel)channel; HandhsakeEvent = new AsyncManualResetEvent(); ConnectDate = DateTimeOffset.Now; var remoteEndPoint = (IPEndPoint)Channel.RemoteAddress; RemoteEndPoint = new IPEndPoint(remoteEndPoint.Address.MapToIPv4(), remoteEndPoint.Port); var localEndPoint = (IPEndPoint)Channel.LocalAddress; LocalEndPoint = new IPEndPoint(localEndPoint.Address.MapToIPv4(), localEndPoint.Port); Logger = Server.Configuration.Logger? .ForContext("HostId", HostId) .ForContext("EndPoint", remoteEndPoint.ToString()); HandleLock = new MaxUseLock(4); }
public void Dispose() { _lock.ReleaseNext(); _lock = null; }
public DisposableObject(MaxUseLock @lock) { _lock = @lock; }