Net/tcp: question for SetKeepAlivePeriod and roundDurationUp

Hi all.
Few days ago, I tried to use TCPConn.SetKeepAlivePeriod and I found this code

As I understand this code, if I pass 1.6 second to roundDurationUp, result must be 2.
If I pass 1.4 second to roundDurationUp, this must be 2 also.

But something strange, isn’t it?
This method work as ceil function not a round function.

How do you think?

“Round up” is another way to say “ceil”.

1 Like


This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.