Home/Support/Support Forum/sock_close(): Time to fully close socket?
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

sock_close(): Time to fully close socket?

0 votes
I'm using an RCM6600W with code which calls tcp_tick() just about once every 80ms.

If I establish a connection, receive a small amount of data, wait 15 seconds, and then call sock_close, I've found that waiting up to 30 seconds does not provide enough time to actually fully close the socket (ie sock_alive() still says the socket is alive after 30 seconds).

When sock_close is called, it looks like the rabbit sends out FIN/ACK when I'd think it should just be sending out FIN, and then waiting for a FIN/ACK from the server before finally accepting an ACK which closes the connection (if wikipedia is to be believed).

Not sure if there are proper deviations from the process, but I think things are breaking down as Windows never sends a FIN or a FIN/ACK in response to the rabbit's FIN/ACK. I'm taking a look at how sock_close works behind the scenes right now and seeing if I can modify it to just send a FIN on close.

At that point hopefully everything will fall into place.
asked Dec 1, 2016 in Rabbit Software by casey New to the Community (18 points)

Please log in or register to answer this question.

1 Answer

+1 vote
You may use sock_abort() to close a connection immediately.
answered Jan 5, 2017 by cpigilam Veteran of the Digi Community (655 points)
...