diff options
author | srinivas%netscape.com <devnull@localhost> | 2000-01-18 20:36:43 +0000 |
---|---|---|
committer | srinivas%netscape.com <devnull@localhost> | 2000-01-18 20:36:43 +0000 |
commit | 33329f7977bf7fdfdfb5c6a69e8cd34fc58cad41 (patch) | |
tree | d14211cb219b1cf808de1de4d1213757ea502018 | |
parent | ee82661b659154abb4e687c0f6dc23355c59b4f6 (diff) | |
download | nspr-hg-33329f7977bf7fdfdfb5c6a69e8cd34fc58cad41.tar.gz |
Fixed performance problem with pollable events on Win32.
Bugzilla #23948.
-rw-r--r-- | pr/src/io/prpolevt.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/pr/src/io/prpolevt.c b/pr/src/io/prpolevt.c index 744f3aed..3e26f226 100644 --- a/pr/src/io/prpolevt.c +++ b/pr/src/io/prpolevt.c @@ -208,6 +208,10 @@ PR_IMPLEMENT(PRFileDesc *) PR_NewPollableEvent(void) { PRFileDesc *event; PRFileDesc *fd[2]; /* fd[0] is the read end; fd[1] is the write end */ +#ifdef USE_TCP_SOCKETPAIR + PRSocketOptionData socket_opt; + PRStatus rv; +#endif fd[0] = fd[1] = NULL; @@ -235,6 +239,13 @@ PR_IMPLEMENT(PRFileDesc *) PR_NewPollableEvent(void) fd[0] = fd[1] = NULL; goto errorExit; } + /* + * set the TCP_NODELAY option to reduce notification latency + */ + socket_opt.option = PR_SockOpt_NoDelay; + socket_opt.value.no_delay = PR_TRUE; + rv = PR_SetSocketOption(fd[1], &socket_opt); + PR_ASSERT(PR_SUCCESS == rv); #endif event->secret->writeEnd = fd[1]; |