]> sjero.net Git - linphone/commitdiff
disable sip keepalive in tcp
authorJehan Monnier <jehan.monnier@linphone.org>
Thu, 3 Feb 2011 15:06:33 +0000 (16:06 +0100)
committerJehan Monnier <jehan.monnier@linphone.org>
Thu, 3 Feb 2011 15:06:33 +0000 (16:06 +0100)
coreapi/sal_eXosip2.c

index b993d88bd8cacabc85b4d3e24524d5a8635e55f1..4d1de476a2c22ea05c40d6feed49de3e734f1333 100644 (file)
@@ -336,13 +336,17 @@ int sal_listen_port(Sal *ctx, const char *addr, int port, SalTransport tr, int i
        int err;
        bool_t ipv6;
        int proto=IPPROTO_UDP;
+       int keepalive = ctx->keepalive_period;
        
        switch (tr) {
        case SalTransportDatagram:
                proto=IPPROTO_UDP;
+               eXosip_set_option (EXOSIP_OPT_UDP_KEEP_ALIVE, &keepalive);      
                break;
        case SalTransportStream:
                proto= IPPROTO_TCP;
+                       keepalive=-1;   
+               eXosip_set_option (EXOSIP_OPT_UDP_KEEP_ALIVE,&keepalive);       
                break;
        default:
                ms_warning("unexpected proto, using datagram");
@@ -363,7 +367,7 @@ int sal_listen_port(Sal *ctx, const char *addr, int port, SalTransport tr, int i
 #ifdef HAVE_EXOSIP_GET_SOCKET
        ms_message("Exosip has socket number %i",eXosip_get_socket(proto));
 #endif
-       eXosip_set_option (EXOSIP_OPT_UDP_KEEP_ALIVE, &ctx->keepalive_period);
+       
        ctx->running=TRUE;
        return err;
 }