public IMessage Read() { try { IMessage message = PDUReader.Read(Reader); return(message); } catch (Exception e) { Logger.Log(e.Message); return(null); } }
public IMessage Read(double msToWait) { IMessage message = null; // message = PDUReader.Read(Reader); Task.Run(() => { try { message = PDUReader.Read(Reader); } catch (Exception e) { Logger.Log(e.Message); } }).Wait(TimeSpan.FromMilliseconds(msToWait)); return(message); }