]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
skypiax: tweak
authorGiovanni Maruzzelli <gmaruzz@gmail.com>
Sun, 28 Feb 2010 11:50:35 +0000 (11:50 +0000)
committerGiovanni Maruzzelli <gmaruzz@gmail.com>
Sun, 28 Feb 2010 11:50:35 +0000 (11:50 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@16846 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/endpoints/mod_skypiax/skypiax.h
src/mod/endpoints/mod_skypiax/skypiax_protocol.c

index ba445431897142515119ae104c80c279c43536d9..fd78c4176e5f403d1b3840251dbfa1e7737beab8 100644 (file)
@@ -47,6 +47,7 @@
 #include <spandsp.h>
 #include <spandsp/version.h>
 
+#include <netinet/tcp.h>
 
 #ifdef _MSC_VER
 //Windows macro  for FD_SET includes a warning C4127: conditional expression is constant
index 82d69eeb33a045c888f04840ddf2ae6b0533af21..654f253b11925fdc1a8ac084b78c55064899426e 100644 (file)
@@ -41,6 +41,7 @@ int skypiax_socket_create_and_bind(private_t * tech_pvt, unsigned short *which_p
        int size = sizeof(int);
 #endif //WIN32
        int sockbufsize = 0;
+       int flag = 0;
 
 
        memset(&my_addr, 0, sizeof(my_addr));
@@ -126,6 +127,16 @@ int skypiax_socket_create_and_bind(private_t * tech_pvt, unsigned short *which_p
        getsockopt(s, SOL_SOCKET, SO_SNDBUF, (char *) &sockbufsize, &size);
        DEBUGA_SKYPE("2 SO_SNDBUF is %d, size is %d\n", SKYPIAX_P_LOG, sockbufsize, size);
 
+        flag = 0;
+        getsockopt(s, IPPROTO_TCP, TCP_NODELAY, (char *) &flag, &size);
+        DEBUGA_SKYPE("TCP_NODELAY is %d\n", SKYPIAX_P_LOG, flag);
+        flag = 1;
+        setsockopt(s, IPPROTO_TCP, TCP_NODELAY, (char *) &flag, size);
+        flag = 0;
+        getsockopt(s, IPPROTO_TCP, TCP_NODELAY, (char *) &flag, &size);
+        DEBUGA_SKYPE("TCP_NODELAY is %d\n", SKYPIAX_P_LOG, flag);
+
+
 
 
        return s;
@@ -804,11 +815,14 @@ void *skypiax_do_tcp_srv_thread_func(void *obj)
 
                                                if (tech_pvt->skype_callflow != CALLFLOW_STATUS_REMOTEHOLD) {
                                                        len = recv(fd, (char *) srv_in, 640, 0);
+                                                       skypiax_sleep(5000);
                                                } else {
+                                                       skypiax_sleep(10000);
                                                        continue;
                                                }
                                                if (tech_pvt->begin_to_read == 0) {
                                                        DEBUGA_SKYPE("len=%d\n", SKYPIAX_P_LOG, len);
+                                                       skypiax_sleep(10000);
                                                        continue;
                                                }
 
@@ -963,6 +977,7 @@ void *skypiax_do_tcp_cli_thread_func(void *obj)
                                                        DEBUGA_SKYPE("len=%d, error: %s\n", SKYPIAX_P_LOG, len, strerror(errno));
                                                        break;
                                                }
+                                               skypiax_sleep(10000);
                                                continue;
                                        }
 #endif //0