libfins
libfins copied to clipboard
Dead loop in fins_tcp_recv()
Using finslib_tcp_connect() connecting PLC, Often the program Dead loop in fins_tcp_recv()
else if ( recv_len < 0 ) { if ( errno == EAGAIN ) {
finslib_milli_second_sleep( 10 );
continue;
}
When the connection terminates or times out, this loop should end eventually. On which operating system and with which compiler suite do you experience the problems?
Thank you for your reply. I compiled it with vs2013 compiler in win10 system
I'll change the code somewhat to make it possible to exit the loop when a timeout is reached.
I'll change the code somewhat to make it possible to exit the loop when a timeout is reached.
Hi there,
I also experienced this problem when server node is offline after tcp connected.
and I don't know how to use the fins_sys_tp::timeout
variable
is there any document describe it's usage?
Does your problem also occur on a Windows based system, or in another environment?
fins_sys_tp::timeout
is set internally based on the the value of FINS_TIMEOUT
. It uses a monotonic clock in the system. This clock is provided by the finslib_monotonic_sec_timer()
function. The implementation is operating system and hardware dependent.
Yes, it’s running on Windows 10 with both VS2005 and VS2015