… | |
… | |
57 | if (!getsockopt (fd, IPPROTO_TCP, TCP_INFO, &tcpi, &len) && len == sizeof (tcpi)) |
57 | if (!getsockopt (fd, IPPROTO_TCP, TCP_INFO, &tcpi, &len) && len == sizeof (tcpi)) |
58 | { |
58 | { |
59 | if (tcpi.tcpi_snd_mss) |
59 | if (tcpi.tcpi_snd_mss) |
60 | mss = tcpi.tcpi_snd_mss; |
60 | mss = tcpi.tcpi_snd_mss; |
61 | |
61 | |
62 | fprintf (stderr, "uack %d sst %d cwnd %d mss %d pmtu %d\n", |
62 | //fprintf (stderr, "uack %d sst %d cwnd %d mss %d pmtu %d\n", |
63 | tcpi.tcpi_unacked, tcpi.tcpi_snd_ssthresh, tcpi.tcpi_snd_cwnd, tcpi.tcpi_advmss, tcpi.tcpi_pmtu); |
63 | // tcpi.tcpi_unacked, tcpi.tcpi_snd_ssthresh, tcpi.tcpi_snd_cwnd, tcpi.tcpi_advmss, tcpi.tcpi_pmtu); |
64 | |
64 | |
65 | if (tcpi.tcpi_last_ack_recv > int (SOCKET_TIMEOUT * 1000)) |
65 | if (tcpi.tcpi_last_ack_recv > int (SOCKET_TIMEOUT * 1000)) |
66 | { |
66 | { |
67 | send_msg (NDI_RED, "connection-timeout", "safety disconnect due to tcp/ip timeout (no packets received)"); |
67 | send_msg (NDI_RED, "connection-timeout", "safety disconnect due to tcp/ip timeout (no packets received)"); |
68 | write_outputbuffer (); |
68 | write_outputbuffer (); |