Revision
16846
Author
gmaruzz
Date
2010-02-28 05:50:35 -0600 (Sun, 28 Feb 2010)

Log Message

skypiax: tweak

Modified Paths

Diff

Modified: freeswitch/trunk/src/mod/endpoints/mod_skypiax/skypiax.h (16845 => 16846)


--- freeswitch/trunk/src/mod/endpoints/mod_skypiax/skypiax.h	2010-02-27 20:39:23 UTC (rev 16845)
+++ freeswitch/trunk/src/mod/endpoints/mod_skypiax/skypiax.h	2010-02-28 11:50:35 UTC (rev 16846)
@@ -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

Modified: freeswitch/trunk/src/mod/endpoints/mod_skypiax/skypiax_protocol.c (16845 => 16846)


--- freeswitch/trunk/src/mod/endpoints/mod_skypiax/skypiax_protocol.c	2010-02-27 20:39:23 UTC (rev 16845)
+++ freeswitch/trunk/src/mod/endpoints/mod_skypiax/skypiax_protocol.c	2010-02-28 11:50:35 UTC (rev 16846)
@@ -41,6 +41,7 @@
 	int size = sizeof(int);
 #endif //WIN32
 	int sockbufsize = 0;
+	int flag = 0;
 
 
 	memset(&my_addr, 0, sizeof(my_addr));
@@ -126,8 +127,18 @@
 	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 @@
 
 						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 @@
 							DEBUGA_SKYPE("len=%d, error: %s\n", SKYPIAX_P_LOG, len, strerror(errno));
 							break;
 						}
+						skypiax_sleep(10000);
 						continue;
 					}
 #endif //0