Commit 7906ad3b authored by Marc Gravell's avatar Marc Gravell

k server working; I was just being daft; still, might as well keep this Client.ID I added

parent 41204570
......@@ -32,6 +32,7 @@ public override async Task OnConnectedAsync(ConnectionContext connection)
if (!makingProgress && read.IsCompleted) break;
}
}
catch (ConnectionResetException) { } // swallow
finally
{
_server.RemoveClient(client);
......
......@@ -34,6 +34,7 @@ internal int Unsubscribe(RedisChannel channel)
public string Name { get; set; }
internal IDuplexPipe LinkedPipe { get; set; }
public bool Closed { get; internal set; }
public int Id { get; internal set; }
public void Dispose()
{
......
......@@ -206,11 +206,13 @@ public int ClientCount
get { lock (_clients) { return _clients.Count; } }
}
public int TotalClientCount { get; private set; }
private int _nextId;
public RedisClient AddClient()
{
var client = CreateClient();
lock (_clients)
{
client.Id = ++_nextId;
ThrowIfShutdown();
_clients.Add(client);
TotalClientCount++;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment