[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[coldsync-hackers] very slow network sync
- To: coldsync-hackers at lusars dot net
- Subject: [coldsync-hackers] very slow network sync
- From: Andrzej Dzik <Andrzej dot Dzik at ekspert.szczecin.pl>
- Date: Tue, 14 Dec 2004 11:32:11 +0100
- Organization: EKSPERT Szczecin
- Reply-to: coldsync-hackers at lusars dot net
- Sender: owner-coldsync-hackers at lusars dot net
- User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; pl-PL; rv:1.6) Gecko/20040113
Hi!
netsync_write_old is very slow in network sync - approx. 10 min on my T3
netsync_write_new - approx. 1 min but not work on Zire(31|72)
Setting TCP_NODELAY on socket help in this situation.
Simply patch below.
regards
Andrzej Dzik
--- PConnection_serial.c.orig Thu Oct 21 00:45:55 2004
+++ PConnection_serial.c Mon Dec 13 13:11:17 2004
@@ -15,6 +15,8 @@
#include <fcntl.h>
#include <termios.h>
#include <errno.h>
+#include <netinet/in.h>
+#include <netinet/tcp.h>
#ifndef HAVE_ENODEV
# define ENODEV 999 /* Some hopefully-impossible value */
@@ -732,6 +734,15 @@
tcsetattr(pconn->fd, TCSANOW, &term); /* Make it so */
/* XXX - Error-checking */
+ } else {
+ int flag = 1;
+ int err = setsockopt(pconn->fd,
+ IPPROTO_TCP,
+ TCP_NODELAY,
+ (char *) &flag,
+ sizeof(int));
+ if (err < 0)
+ fprintf(stderr, "Can't set tcp_nodelay\n");
}
/* XXX Should this message go to stderr instead? */