[sr-dev] TCP connection close event

Camille Oudot camille.oudot at orange.com
Thu Oct 1 19:34:41 CEST 2015


Hi Olle,

> Looking into usrloc source code it seems pretty trivial to create a
> function that can check if a TCP connection is considered alive and
> well.
> 
> tcp_conn_check($conid)
> 
> Camille - is it ok if I try to create something like that in your
> tcpops module? It seems to fit in there just fine.  

Yes, to me it's perfectly fine to add this function here, or could even
be a more generic tcp_conn_state($conid), retuning a value that mirrors
the corresponding enum (+1 for the >= 0 values):

enum tcp_conn_states { S_CONN_ERROR=-2, S_CONN_BAD=-1,
  S_CONN_OK=0, /* established (write or read) */
  S_CONN_INIT, /* initial state (invalid) */
  S_CONN_EOF,
  S_CONN_ACCEPT, S_CONN_CONNECT
};

-- 
Camille



More information about the sr-dev mailing list