Why does TCP_INFO option on getsockopt() return contradicting values?

1.1k views Asked by At

I do a

getsockopt(sfd, SOL_TCP, TCP_INFO, (void *)&info, (socklen_t *)&infoLen)

When I print the tcpi_state and tcpi_ca_state I get

tcpi_state = 7   (CLOSE)
tcpi_ca_state = 0  (OPEN)

The getsockopt with SO_ERROR returns no error (0).

What should I make of this ?

When I did a getpeername using the sfd, I got back "Transport endpoint not connected".

Is the tcp_info struct not dependable?

0

There are 0 answers