mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-18 10:26:11 +08:00
Refactor code.
This commit is contained in:
@@ -72,11 +72,10 @@ namespace MQTTnet.Implementations
|
||||
{
|
||||
#if NET452 || NET461
|
||||
var clientSocket = await Task.Factory.FromAsync(_socket.BeginAccept, _socket.EndAccept, null).ConfigureAwait(false);
|
||||
return new CrossPlatformSocket(clientSocket);
|
||||
#else
|
||||
var clientSocket = await _socket.AcceptAsync().ConfigureAwait(false);
|
||||
return new CrossPlatformSocket(clientSocket);
|
||||
#endif
|
||||
return new CrossPlatformSocket(clientSocket);
|
||||
}
|
||||
catch (ObjectDisposedException)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user