mirror of
https://github.com/debauchee/barrier.git
synced 2026-02-08 04:45:03 +08:00
fixes to avoid update delays.
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <netinet/tcp.h> // FIXME -- for disabling nagle algorithm
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include <netdb.h>
|
||||
@@ -29,6 +30,13 @@ CUnixTCPSocket::CUnixTCPSocket() : m_fd(-1),
|
||||
::close(m_fd);
|
||||
throw XSocketCreate(::strerror(errno));
|
||||
}
|
||||
|
||||
// turn off Nagle algorithm. we send lots of really short messages.
|
||||
struct protoent* p = getprotobyname("tcp");
|
||||
if (p) {
|
||||
int on = 1;
|
||||
setsockopt(m_fd, p->p_proto, TCP_NODELAY, &on, sizeof(on));
|
||||
}
|
||||
}
|
||||
|
||||
CUnixTCPSocket::CUnixTCPSocket(int fd) : m_fd(fd),
|
||||
|
||||
Reference in New Issue
Block a user