public byte[] ReceiveDataStream() { byte[] ret = null; try { ret = _dataChannel.Receive(TimeSpan.FromSeconds(EXECTIMEOUT)) as byte[]; } catch (SemaphoreFailedException exc) { // ignore if nothing to receive and wait for response again FI.Common.LogWriter.Instance.WriteEventLogEntry(_cmdChannelType.ToString() + ":ReceiveDataStream SemaphoreFailedException"); exc = null; } return(ret); }
public void CleanupChannels() { if (_dataChannel == null) { return; } // cleanup channel - receive data try { _dataChannel.Receive(TimeSpan.FromMilliseconds(100)); } catch (SemaphoreFailedException exc) { // ignore nothing to receive } // cleanup channel - receive data try { _contrCmdChannel.Receive(TimeSpan.FromMilliseconds(100)); } catch (SemaphoreFailedException exc) { // ignore nothing to receive } // cleanup channel - receive data try { _processorCmdChannel.Receive(TimeSpan.FromMilliseconds(100)); } catch (SemaphoreFailedException exc) { // ignore nothing to receive } }
/// <summary> /// Lie le prochain frame dans la queue /// </summary> public Frame ReadFrame() { return(_pictureTransfert.Receive() as Frame); }