예제 #1
0
        private void Channel_OnClose(object sender, ChannelCloseEventArgs e)
        {
            shutdown = true;
            logger?.LogInformation("SCADA client channel is closed.");
            try
            {
                connection.CloseAsync().GetAwaiter();
                logger?.LogDebug("Closing VRTU Web socket connection.");
            }
            catch { }

            connection = null;
            OnClose?.Invoke(this, new AdapterCloseEventArgs(Id));
        }
예제 #2
0
 private async void SendCloseWhenOutputCompleted()
 {
     await _output.Reading;
     await _webSocket.CloseAsync();
 }