we have developed a TCP client on a Gateway which runs Node.Red 0.11. This device receives LoRa messages from a LoRa In node and forwards these to our own network service through a TCP Out which connects to a IP:Port.
Meanwhile, a TCP In node connects to the same IP:Port and forwards incoming messages to the LoRa nodes through a LoRa out node.
In our service we see two TCP sockets connected from our gateway IP address and two different ports. From one of them we receive the messages and through the other one we can send our responses.
This is working fine except when the 3G interface (ppp0) is given a new IP once every 24h. We check this using an Exec node with ifconfig ppp0 command and store this info in a log file. At this time we don't receive any more messages in our service for approx. the next 30 minutes. Meanwhile there is no error ouput in the debug tab and the TCP nodes remain "connected". After this period, new socket is established from the new IP and messages are passing through again. We have tried "close connection after each message is send" but there is no difference.
Moreover, since the first IP change (after the first 24h) the TCP In socket is not created from the new 3G IP, therefore leaving the gateway unreachable. TCP In node remains though "connected".
We have checked the sockets with lsof -np and it turns out that there is a TCP socket connected to our service from the oldest ip marked as "ESTABLISHED" which must be the one belonging to the TCP In node (which doesn't work). The other socket connected to our service has the updated IP except during that half an hour after the IP change. During those minutes the origin IP doesn't match the one of the ppp0 interface and the socket is marked as FIN_WAIT1.
Is there some way to reset the TCP connections? Is it a known issue of this node.red version?
Thanks in advance for the help.