mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-20 19:58:57 +08:00
Refactor event handler namings.
This commit is contained in:
@@ -15,6 +15,7 @@ namespace MQTTnet.Server
|
||||
{
|
||||
private readonly BlockingCollection<MqttEnqueuedApplicationMessage> _messageQueue = new BlockingCollection<MqttEnqueuedApplicationMessage>();
|
||||
|
||||
private readonly SemaphoreSlim _createConnectionGate = new SemaphoreSlim(1, 1);
|
||||
private readonly ConcurrentDictionary<string, MqttClientConnection> _connections = new ConcurrentDictionary<string, MqttClientConnection>();
|
||||
private readonly ConcurrentDictionary<string, MqttClientSession> _sessions = new ConcurrentDictionary<string, MqttClientSession>();
|
||||
|
||||
@@ -49,8 +50,6 @@ namespace MQTTnet.Server
|
||||
|
||||
public async Task StopAsync()
|
||||
{
|
||||
//using (await _sessionsLock.WaitAsync(CancellationToken.None).ConfigureAwait(false))
|
||||
|
||||
foreach (var connection in _connections.Values)
|
||||
{
|
||||
await connection.StopAsync().ConfigureAwait(false);
|
||||
@@ -133,7 +132,7 @@ namespace MQTTnet.Server
|
||||
{
|
||||
if (_connections.TryGetValue(clientId, out var connection))
|
||||
{
|
||||
await connection.StopAsync();
|
||||
await connection.StopAsync().ConfigureAwait(false);
|
||||
}
|
||||
|
||||
if (_sessions.TryRemove(clientId, out var session))
|
||||
@@ -313,8 +312,6 @@ namespace MQTTnet.Server
|
||||
return context;
|
||||
}
|
||||
|
||||
private readonly SemaphoreSlim _createConnectionGate = new SemaphoreSlim(1, 1);
|
||||
|
||||
private async Task<MqttClientConnection> CreateConnectionAsync(IMqttChannelAdapter channelAdapter, MqttConnectPacket connectPacket)
|
||||
{
|
||||
await _createConnectionGate.WaitAsync(_cancellationToken).ConfigureAwait(false);
|
||||
|
||||
Reference in New Issue
Block a user