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) ...@@ -32,6 +32,7 @@ public override async Task OnConnectedAsync(ConnectionContext connection)
if (!makingProgress && read.IsCompleted) break; if (!makingProgress && read.IsCompleted) break;
} }
} }
catch (ConnectionResetException) { } // swallow
finally finally
{ {
_server.RemoveClient(client); _server.RemoveClient(client);
......
...@@ -34,6 +34,7 @@ internal int Unsubscribe(RedisChannel channel) ...@@ -34,6 +34,7 @@ internal int Unsubscribe(RedisChannel channel)
public string Name { get; set; } public string Name { get; set; }
internal IDuplexPipe LinkedPipe { get; set; } internal IDuplexPipe LinkedPipe { get; set; }
public bool Closed { get; internal set; } public bool Closed { get; internal set; }
public int Id { get; internal set; }
public void Dispose() public void Dispose()
{ {
......
...@@ -206,11 +206,13 @@ public int ClientCount ...@@ -206,11 +206,13 @@ public int ClientCount
get { lock (_clients) { return _clients.Count; } } get { lock (_clients) { return _clients.Count; } }
} }
public int TotalClientCount { get; private set; } public int TotalClientCount { get; private set; }
private int _nextId;
public RedisClient AddClient() public RedisClient AddClient()
{ {
var client = CreateClient(); var client = CreateClient();
lock (_clients) lock (_clients)
{ {
client.Id = ++_nextId;
ThrowIfShutdown(); ThrowIfShutdown();
_clients.Add(client); _clients.Add(client);
TotalClientCount++; 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