Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

216
Vistas
Get cwnd of my TCP connection from a program

I am creating a TCP connection from my linux program with boost.asio. I wonder how do I get the value of its congestion window (cwnd) from the program? The only way I know of is to parse /proc/net/tcp, but this does not feel right. I'd rather use a dedicated syscall to get this info.

A solution to a similar question (How to monitor cwnd and ssthresh values for a TCP connection?) suggests using TCP Probe, but it feels even less appealing.

So what is the best way to get the value of cwnd?

over 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

I did this with netlink and INET_DIAG-sockets based on this helpful example: https://github.com/kristrev/inet-diag-example

over 4 years ago · Santiago Trujillo Denunciar

0

It turned out getsockopt() is able to return the same tcp_info when called with TCP_INFO option:

  tcp_info tcpi = {};
  socklen_t len = sizeof(tcp_info);
  getsockopt(tcp_socket, SOL_TCP, TCP_INFO, &tcpi, &len);
  tcpi.tcpi_snd_cwnd;  // <-- CWND
over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda