Author: adrian.chadd
Date: Wed Mar 18 07:42:27 2009
New Revision: 13869
Modified:
branches/LUSCA_HEAD/libiapp/comm.c
branches/LUSCA_HEAD/libiapp/comm.h
Log:
Add in commSetTcpBufferSize(), a quick hack to set the send/receive
buffer size.
Modified: branches/LUSCA_HEAD/libiapp/comm.c
==============================================================================
--- branches/LUSCA_HEAD/libiapp/comm.c (original)
+++ branches/LUSCA_HEAD/libiapp/comm.c Wed Mar 18 07:42:27 2009
@@ -1056,6 +1056,23 @@
fd_table[fd].flags.nodelay = 1;
}
+int
+commSetTcpBufferSize(int fd, int size)
+{
+ int r, err = 1;
+ int s = size;
+
+ r = setsockopt(fd, SOL_SOCKET, SO_SNDBUF, (char *) &s, sizeof(s));
+ if (r < 0)
+ err = 0;
+
+ s = size;
+ r = setsockopt(fd, SOL_SOCKET, SO_RCVBUF, (char *) &s, sizeof(s));
+ if (r < 0)
+ err = 0;
+ return err;
+}
+
void
commSetTcpKeepalive(int fd, int idle, int interval, int timeout)
{
Modified: branches/LUSCA_HEAD/libiapp/comm.h
==============================================================================
--- branches/LUSCA_HEAD/libiapp/comm.h (original)
+++ branches/LUSCA_HEAD/libiapp/comm.h Wed Mar 18 07:42:27 2009
@@ -232,6 +232,7 @@
extern int commSetNonBlocking(int fd);
extern int commUnsetNonBlocking(int fd);
extern void commSetCloseOnExec(int fd);
+extern int commSetTcpBufferSize(int fd, int buffer_size);
extern void commSetTcpKeepalive(int fd, int idle, int interval, int
timeout);
extern int commSetTos(int fd, int tos);
extern int commSetSocketPriority(int fd, int prio);
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"lusca-commit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/lusca-commit?hl=en
-~----------~----~----~----~------~----~------~--~---