How to check for alive connection in TCP

KP
Khoa Pham
Wed, Apr 10, 2013 8:19 AM

Hi,

I'm using TCP to make REGISTER. TCP will create a connection between us and
registrar server.

  1. How to check if our registration stills valid on registrar  ?? (to let
    other clients to not see the "Not found" message when calling us)
  2. How to check if this TCP connection is still alive ?? (If this
    connection is broken, server will not be able to send us INVITE)

--
Khoa Pham
HCMC University of Science
Faculty of Information Technology

Hi, I'm using TCP to make REGISTER. TCP will create a connection between us and registrar server. 1. How to check if our registration stills valid on registrar ?? (to let other clients to not see the "Not found" message when calling us) 2. How to check if this TCP connection is still alive ?? (If this connection is broken, server will not be able to send us INVITE) -- Khoa Pham HCMC University of Science Faculty of Information Technology
GG
Gustavo Garcia Bernardo
Wed, Apr 10, 2013 8:48 AM

Inline...

  1. How to check if our registration stills valid on registrar  ?? (to let other clients to not see the "Not found" message when calling us)

There is no reason for a registration not to be valid.  Can you explain the use case/scenario where you need that?

  1. How to check if this TCP connection is still alive ?? (If this connection is broken, server will not be able to send us INVITE)

TCP keepalives (as per rfc5626) are used for this.    I think they are enabled by default in pjsip:
http://www.pjsip.org/pjsip/docs/html/structpjsua__acc__config.htm#a98722b6464d16b5a76aec81f2d2a0694

--
Khoa Pham
HCMC University of Science
Faculty of Information Technology


Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip@lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org


Este mensaje se dirige exclusivamente a su destinatario. Puede consultar nuestra política de envío y recepción de correo electrónico en el enlace situado más abajo.
This message is intended exclusively for its addressee. We only send and receive email on the basis of the terms set out at:
http://www.tid.es/ES/PAGINAS/disclaimer.aspx

Inline... > 1. How to check if our registration stills valid on registrar ?? (to let other clients to not see the "Not found" message when calling us) There is no reason for a registration not to be valid. Can you explain the use case/scenario where you need that? > 2. How to check if this TCP connection is still alive ?? (If this connection is broken, server will not be able to send us INVITE) TCP keepalives (as per rfc5626) are used for this. I think they are enabled by default in pjsip: http://www.pjsip.org/pjsip/docs/html/structpjsua__acc__config.htm#a98722b6464d16b5a76aec81f2d2a0694 > > -- > Khoa Pham > HCMC University of Science > Faculty of Information Technology > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing list > pjsip@lists.pjsip.org > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org ________________________________ Este mensaje se dirige exclusivamente a su destinatario. Puede consultar nuestra política de envío y recepción de correo electrónico en el enlace situado más abajo. This message is intended exclusively for its addressee. We only send and receive email on the basis of the terms set out at: http://www.tid.es/ES/PAGINAS/disclaimer.aspx
KP
Khoa Pham
Wed, Apr 10, 2013 8:58 AM

@Gustavo: thanks for your prompt reply

  1. In the REGISTER message, there is Expire field, which indicates the
    expire time for this registration.
  2. TCP keep alive, AFAIK, is only useful for NAT scenario, because NAT
    router only keep NAT binding for most recent active connection.
    I'm targeting iOS. When my iOS app enters background, this TCP connection
    can be killed by OS (due to lack of resource). When my app enter foreground
    again, how to know if this connection is still alive ?

On Wed, Apr 10, 2013 at 3:48 PM, Gustavo Garcia Bernardo ggb@tid.es wrote:

Inline...

  1. How to check if our registration stills valid on registrar  ?? (to

let other clients to not see the "Not found" message when calling us)

There is no reason for a registration not to be valid.  Can you explain
the use case/scenario where you need that?

  1. How to check if this TCP connection is still alive ?? (If this

connection is broken, server will not be able to send us INVITE)

TCP keepalives (as per rfc5626) are used for this.    I think they are
enabled by default in pjsip:

http://www.pjsip.org/pjsip/docs/html/structpjsua__acc__config.htm#a98722b6464d16b5a76aec81f2d2a0694

--
Khoa Pham
HCMC University of Science
Faculty of Information Technology


Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip@lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org


Este mensaje se dirige exclusivamente a su destinatario. Puede consultar
nuestra política de envío y recepción de correo electrónico en el enlace
situado más abajo.
This message is intended exclusively for its addressee. We only send and
receive email on the basis of the terms set out at:
http://www.tid.es/ES/PAGINAS/disclaimer.aspx


Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip@lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org

--
Khoa Pham
HCMC University of Science
Faculty of Information Technology

@Gustavo: thanks for your prompt reply 1. In the REGISTER message, there is Expire field, which indicates the expire time for this registration. 2. TCP keep alive, AFAIK, is only useful for NAT scenario, because NAT router only keep NAT binding for most recent active connection. I'm targeting iOS. When my iOS app enters background, this TCP connection can be killed by OS (due to lack of resource). When my app enter foreground again, how to know if this connection is still alive ? On Wed, Apr 10, 2013 at 3:48 PM, Gustavo Garcia Bernardo <ggb@tid.es> wrote: > Inline... > > > 1. How to check if our registration stills valid on registrar ?? (to > let other clients to not see the "Not found" message when calling us) > > There is no reason for a registration not to be valid. Can you explain > the use case/scenario where you need that? > > > 2. How to check if this TCP connection is still alive ?? (If this > connection is broken, server will not be able to send us INVITE) > > TCP keepalives (as per rfc5626) are used for this. I think they are > enabled by default in pjsip: > > http://www.pjsip.org/pjsip/docs/html/structpjsua__acc__config.htm#a98722b6464d16b5a76aec81f2d2a0694 > > > > > -- > > Khoa Pham > > HCMC University of Science > > Faculty of Information Technology > > _______________________________________________ > > Visit our blog: http://blog.pjsip.org > > > > pjsip mailing list > > pjsip@lists.pjsip.org > > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org > > > ________________________________ > > Este mensaje se dirige exclusivamente a su destinatario. Puede consultar > nuestra política de envío y recepción de correo electrónico en el enlace > situado más abajo. > This message is intended exclusively for its addressee. We only send and > receive email on the basis of the terms set out at: > http://www.tid.es/ES/PAGINAS/disclaimer.aspx > > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing list > pjsip@lists.pjsip.org > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org > -- Khoa Pham HCMC University of Science Faculty of Information Technology