Merge "set /proc/sys/net/unix/max_dgram_qlen to large value"

This commit is contained in:
Mark Salyzyn 2014-03-04 00:06:25 +00:00 committed by Gerrit Code Review
commit 858d0dd1e5
4 changed files with 9 additions and 2 deletions

View File

@ -38,6 +38,7 @@ public:
virtual ~SocketListener();
int startListener();
int startListener(int backlog);
int stopListener();
void sendBroadcast(int code, const char *msg, bool addErrno);

View File

@ -70,6 +70,10 @@ SocketListener::~SocketListener() {
}
int SocketListener::startListener() {
return startListener(4);
}
int SocketListener::startListener(int backlog) {
if (!mSocketName && mSock == -1) {
SLOGE("Failed to start unbound listener");
@ -84,7 +88,7 @@ int SocketListener::startListener() {
SLOGV("got mSock = %d for %s", mSock, mSocketName);
}
if (mListen && listen(mSock, 4) < 0) {
if (mListen && listen(mSock, backlog) < 0) {
SLOGE("Unable to listen on socket (%s)", strerror(errno));
return -1;
} else if (!mListen)

View File

@ -105,7 +105,8 @@ int main() {
// and LogReader is notified to send updates to connected clients.
LogListener *swl = new LogListener(logBuf, reader);
if (swl->startListener()) {
// Backlog and /proc/sys/net/unix/max_dgram_qlen set to large value
if (swl->startListener(300)) {
exit(1);
}

View File

@ -100,6 +100,7 @@ loglevel 3
write /proc/sys/kernel/dmesg_restrict 1
write /proc/sys/vm/mmap_min_addr 32768
write /proc/sys/net/ipv4/ping_group_range "0 2147483647"
write /proc/sys/net/unix/max_dgram_qlen 300
write /proc/sys/kernel/sched_rt_runtime_us 950000
write /proc/sys/kernel/sched_rt_period_us 1000000