diff options
| author | Andy Wingo <wingo@pobox.com> | 2017-02-15 21:31:57 +0100 |
|---|---|---|
| committer | Andy Wingo <wingo@pobox.com> | 2017-02-15 21:31:57 +0100 |
| commit | afb73d7437083500bf31c88b78f041e7e6ab0252 (patch) | |
| tree | dd7b564e9557be58b0dc0347c78a921ef12baaae | |
| parent | Fix epoll-modify logic (diff) | |
| download | guile-fibers-afb73d7437083500bf31c88b78f041e7e6ab0252.tar.gz | |
Tweak fibers web socket options
* fibers/web/server.scm (client-loop): Move NODELAY things here and
actually enable NODELAY (before we were... disabling it???).
(socket-loop): Remove SNDBUF munging; let's assume it doesn't matter
rather than the reverse.
| -rw-r--r-- | fibers/web/server.scm | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/fibers/web/server.scm b/fibers/web/server.scm index dbca90d..72be34b 100644 --- a/fibers/web/server.scm +++ b/fibers/web/server.scm @@ -177,6 +177,10 @@ on the procedure being called at any particular time." (else #f))))) (define (client-loop client handler) + ;; Always disable Nagle's algorithm, as we handle buffering + ;; ourselves; when we force-output, we really want the data to go + ;; out. + (setsockopt client IPPROTO_TCP TCP_NODELAY 1) (with-throw-handler #t (lambda () (let loop () @@ -215,13 +219,6 @@ on the procedure being called at any particular time." (let loop () (match (accept socket) ((client . sockaddr) - ;; From "HOP, A Fast Server for the Diffuse Web", Serrano. - (setsockopt client SOL_SOCKET SO_SNDBUF (* 12 1024)) - ;; Always disable Nagle's algorithm, as we handle buffering - ;; ourselves. Ignore exceptions if it's not a TCP port, or - ;; TCP_NODELAY is not defined on this platform. - (false-if-exception - (setsockopt client IPPROTO_TCP TCP_NODELAY 0)) (spawn-fiber (lambda () (set-nonblocking! client) (client-loop client handler)) |
