public void Stop() { if (_poller != null) { _poller.Dispose(); } if (_communication != null) { _communication.Close(); } _connected = false; _poller = null; }
/// <summary> /// Notifies the observer that the provider has finished sending push-based notifications. /// </summary> public void OnCompleted() { /* * Completion of the transaction pipeline means that the client has disconnected and there will be no more transactions. * In that case, we can safely close the communications channel. */ channel.Close(); }
/// <summary>Notifies the observer that the provider has finished sending push-based notifications.</summary> public void OnCompleted() { /* * Completion of the transaction pipeline means that the client has disconnected and there will be no more transactions. * In that case, we can safely close the communications channel. */ log.Info().Message("End of transaction sequence - closing channel").Write(); channel.Close(); }
public void Close() { UnsubscribeControllerEvents(); if (IsConnected) { stateMachine.SavePersistentSettings(); channel.Close(); } }
public void Close() { running = false; if (serialChannel != null) { serialChannel.Close(); serialChannel = null; } }
public void Close() { log.Info().Message("Device Controller closing").Write(); UnsubscribeControllerEvents(); if (IsConnected) { connectedTimestamp = DateTime.MinValue; stateMachine.SavePersistentSettings(); channel.Close(); } log.Info().Message("Device Controller closed").Write(); }
/// <summary> /// Destroys the transaction processor and its dependencies. Ensures that the /// <see cref="Channel" /> is closed. Once this method has been called, the /// <see cref="Channel" /> and <see cref="Endpoint" /> properties will be null. A new /// connection to the same endpoint can be created by calling /// <see cref="CreateTransactionProcessor" /> again. /// </summary> public void DestroyTransactionProcessor() { processor?.Dispose(); processor = null; // [Sentinel] observer = null; if (Channel?.IsOpen ?? false) { Channel.Close(); } Channel?.Dispose(); Channel = null; // [Sentinel] GC.Collect(3, GCCollectionMode.Forced, blocking: true); }
private bool OnCommunicationChannelReceived(ICommunicationChannel communicationChannel, IPEndPoint remoteEndPoint, int receivedBytes) { // If no data was received, close the connection. This is a NORMAL // situation that shows when the client has finished sending data. if (receivedBytes == 0) { _log.Info($"ProcessReceive NO DATA from IP {communicationChannel.RemoteIPAddress}"); communicationChannel.Close(); return(false); } return(true); }
public async Task Stop() { running = false; stopWatch.Stop(); //commandsBufferBlock.Complete(); actionBlock.Complete(); Flush(); await Task.Delay(100); // Notify users to clean up any devices // connected to the serial port if need be, before closing it. arduinoBrick.StoppingCommunication(serialChannel); if (serialChannel != null) { serialChannel.DiscardInBuffer(); serialChannel.Close(); serialChannel = null; } }
public async Task Stop() { running = false; stopWatch.Stop(); sem.Up(); await Task.Delay(100); // Notify users to clean up any devices // connected to the serial port if need be, before closing it. element.StoppingCommunication(serialChannel); if (serialChannel != null) { // Clear receive buffer out, since the bootloader can send // some just characters, which might hose subsequent command responses: //serialPort.DiscardInBuffer(); serialChannel.Close(); serialChannel = null; } }
/// <summary> /// Closes the specified channel. /// </summary> /// <param name="channel">The channel.</param> /// <param name="reason">The reason.</param> public override void Close(ICommunicationChannel channel, CloseReason reason) { channel.Close(reason); }
public void Close() { UnsubscribeControllerEvents(); channel.Close(); }
// // PUBLIC INTERFACE // public void Stop() { _poller.Dispose(); _communication.Close(); _connected = false; }