public async Task StopReceiveAsync() { await PipeLock.WaitAsync().ConfigureAwait(false); if (Receive) { Receive = false; } PipeLock.Release(); }
public async Task StopWriteAsync() { await PipeLock.WaitAsync().ConfigureAwait(false); if (Write) { Write = false; } PipeLock.Release(); }
public async Task StartReceiveAsync() { await PipeLock.WaitAsync().ConfigureAwait(false); if (!Receive) { Receive = true; await QuickListeningSocket .BindSocketToAddressAsync(100) .ConfigureAwait(false); ReceiveLoopTask = Task.Run(ReceiveAsync); } PipeLock.Release(); }
public async Task StartWritingAsync() { await PipeLock.WaitAsync().ConfigureAwait(false); if (!Write) { Write = true; } await QuickSocket .ConnectToPrimaryAddressAsync() .ConfigureAwait(false); WriteLoopTask = Task.Run(WriteAsync); PipeLock.Release(); }