Hi,
I'M writing a c# app using the IRTrans.NET.dll (v. 3.1.2.0) with the Irtrans USB device. I want t send ir commands to a media receiver. Usually everything works fine and the commands are send with a latency < 20ms, my Code :
.....
irt = new IRTransServer("localhost");
.....
if (null != irt) {
if (Monitor.TryEnter(irt, 250)) {
try {
long start = DateTime.Now.Ticks;
NETWORKSTATUS stat = irt.IRSend(IRTRANS_RECEIVER, command);
long diff = (DateTime.Now.Ticks - start) / 10000;
if (stat != null || diff > 200) {
logger.Error("irtrans: IR ERROR: cmd=" + command + ", " + diff + "ms");
if (stat != null) {
logger.Error("irtrans: message=" + stat.message + ", adress=" + stat.adress + ", netstatus=" + stat.netstatus + ", statuslevel=" + stat.statuslevel);
}
} else {
if (logger.IsDebugEnabled) logger.Debug("irtrans: cmd=" + command + ", " + diff + "ms");
}
} catch (System.Net.Sockets.SocketException sockEx) {
logger.Error("irtrans: " + sockEx, sockEx);
} catch (IRTrans.NET.IRTransConnectionException connEx) {
logger.Error("irtrans: " + connEx, connEx);
} catch (Exception ex) {
logger.Error("irtrans: " + ex, ex);
} finally {
Monitor.Exit(irt);
}
} else {
logger.Error("irtrans: IrSend currently locked by another thread, cmd=" + command);
}
Sometimes, the latency (diff) is up to 4 Seconds and more to send a signal. The System load is less than 5%. Do you have any idea how to resolve that problem?
I have 15 systems and every system has the same problem. Irtrans Server is running as a windows service, IrServer Version is 6.2.23.0. Operating System is Windows XP, SP3
Best Regards,
Tony