private void OnRead(IAsyncResult ar)
{
try
{
int bytesRead = _deviceInterfaceFile.Stream.EndRead(ar);
_log.Debug("Read " + bytesRead + "bytes");
BeginAsyncRead();
}
catch (Exception ex)
{
_log.Error("read failed", ex);
try
{
CheckConnection();
}
catch (Exception ex2)
{
_log.Error("CheckConnection", ex2);
}
}
}