cts
This commit is contained in:
@@ -50,10 +50,11 @@ namespace ConsoleApp.TelnetSamples
|
||||
byte[] readBuffer = new byte[1024];
|
||||
while (true)
|
||||
{
|
||||
if (_cts != null && _cts.IsCancellationRequested)
|
||||
//Thread.Sleep(100);
|
||||
if (_cts.IsCancellationRequested)
|
||||
break;
|
||||
|
||||
int bytesRead = _cts != null && _cts.IsCancellationRequested ? 0 : await _socket.ReceiveAsync(readBuffer);
|
||||
int bytesRead = await _socket.ReceiveAsync(readBuffer);
|
||||
if (bytesRead < 1)
|
||||
{
|
||||
if (sb.Length > 0 && this.MessageCallback != null)
|
||||
|
Reference in New Issue
Block a user