/// <summary> /// Constructs a new instance of FramingReader. /// </summary> /// <param name="baseReader">The EmberReader used to decode the ember data.</param> /// <param name="keepAliveCallback">A callback function that is subscribed to /// the KeepAliveRequestReceived event.</param> public FramingReader(AsyncEmberReader baseReader, EventHandler<KeepAliveRequestReceivedArgs> keepAliveCallback) { if(baseReader == null) throw new ArgumentNullException("baseReader"); BaseReader = baseReader; if(keepAliveCallback != null) KeepAliveRequestReceived += keepAliveCallback; _rxFrame = new S101.RxFrame(); _rxFrame.MessageReceived += RxFrame_MessageReceived; }
/// <summary> /// Dispose of allocated resources. /// </summary> /// <param name="disposing">If true, dispose of unmanaged resources /// otherwise only dispose of managed resources</param> protected virtual void Dispose(bool disposing) { if(_rxFrame != null) _rxFrame.Dispose(); _rxFrame = null; }