In S7Client, the method WaitForData slows down the communication because of the sleep.
In java, the resolution of sleep is 10ms, so sleep(1) actually takes 10ms.
I would suggest to set a socket timeout and do one or more blocking reads for the timeout desired:
private int RecvPacket(byte[] Buffer,
int Start,
int Size)
{
int res;
The method GetPlcDateTime takes a reference to a date object as an argument, but never returns the actual result date. Probably a conversion error from the original language.
In RecvIsoPacket is a RecvPacket() call of which the return code is not checked.
Why use a global LastError variable that is returned by almost all method calls anyway? Wouldn't it be cleaner to just check the return code of method calls? Tools like findbugs help to find methods of which return codes are ignored.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
In S7Client, the method WaitForData slows down the communication because of the sleep.
In java, the resolution of sleep is 10ms, so sleep(1) actually takes 10ms.
I would suggest to set a socket timeout and do one or more blocking reads for the timeout desired:
private int RecvPacket(byte[] Buffer,
int Start,
int Size)
{
int res;
}
The method GetPlcDateTime takes a reference to a date object as an argument, but never returns the actual result date. Probably a conversion error from the original language.
In RecvIsoPacket is a RecvPacket() call of which the return code is not checked.
Why use a global LastError variable that is returned by almost all method calls anyway? Wouldn't it be cleaner to just check the return code of method calls? Tools like findbugs help to find methods of which return codes are ignored.
Hi Marc,
thanks for reporting ;)
I will look at it as I have 5 min of free time.
regards