WIZnet Developer Forum

WIZ107SR keepalive

Hi,
I have my WIZ configured as server. In normal operation WIZ only receives bytes from remote TCP client. There is no need for any transmission in opposite direction. Unfortunately the client is a really stupid device (no possibility to change this) and when it is being switched off it does not send FIN. When it happens port is still opened and no connection can be made. I wanted to use keep alive packets to check if the client is still available. But when the client connects no keepalives are sent despite they are enabled in configuration tool. No matter how many packets are received by WIZ it is not transmitting k-a packets. But it is enough to send only one packet from WIZ to device and k-a magically appears. Is it normal behavior? Shouldn’t they be sent immediately when client connects?
Best Regards
Leszek

Hello,

Yes, it is a normal process of Keep alive function in WIZ107SR.
All WIZnet TCP/IP chip including W7100A which is adapted in WIZ107SR uses TX pointer value to implement Keep alive function. It means W7100A needs to send at least one bytes.

So I recommend you send any garbage data to your Client immediately whenever you got connection from it.
If it is impossible to send dummy data to your Client, you’d better use “inactivity timer” instead of “Keep Alive” function.
With “inactivity timer” option, you can close any connection which may lose its logical path.
If there is no data from serial port during the period which you set in “inactivity timer” field, then WIZ107SR will close the socket connection activley. WIZ107SR supposes that the socket connection is virtually closed by something like abnormal shutdown of peer system then data transfer doesn’t happen.

If your system send data continuously to WIZ107SR via serial port regardless of its socket connection, however, then it may not be a good solution for you.
Then we need more consideration to solve your problem.

Please give me your feedback.

Thank you.

javakys

Thank you for a quick reply. In that case I will need to implement sending dummy data to the client. It is a solution but I think it would be worth revising if the only trigger should be TX pointer. May be it would be better to take RX into account too or even current connection status set in the module.
Best Regards
Leszek

Copyright © 2017 WIZnet Co., Ltd. All Rights Reserved.