am 858d0dd1: Merge "set /proc/sys/net/unix/max_dgram_qlen to large value"
* commit '858d0dd1e529575181abd8de607e46f7b273cc9d': set /proc/sys/net/unix/max_dgram_qlen to large value
This commit is contained in:
commit
f447c1b3ae
|
@ -38,6 +38,7 @@ public:
|
|||
|
||||
virtual ~SocketListener();
|
||||
int startListener();
|
||||
int startListener(int backlog);
|
||||
int stopListener();
|
||||
|
||||
void sendBroadcast(int code, const char *msg, bool addErrno);
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue