diff options
author | Eric Wong <normalperson@yhbt.net> | 2011-05-09 04:39:54 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2011-05-10 08:20:27 +0000 |
commit | 704f843054f3ca32941d42972a1c7d1b144d06ad (patch) | |
tree | 2e7fea212988a9a67b7cdfab3ef939a221448e65 /lib/rainbows/client.rb | |
parent | 598525843ee1d120fd9878011ca2b6328c2cf95f (diff) | |
download | rainbows-704f843054f3ca32941d42972a1c7d1b144d06ad.tar.gz |
There's actually no reason we can't have these methods in Rainbows::Configurator where it's easier to document nowadays.
Diffstat (limited to 'lib/rainbows/client.rb')
-rw-r--r-- | lib/rainbows/client.rb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/rainbows/client.rb b/lib/rainbows/client.rb index 4608f53..b044f26 100644 --- a/lib/rainbows/client.rb +++ b/lib/rainbows/client.rb @@ -5,20 +5,21 @@ require "io/wait" # this class is used for most synchronous concurrency models class Rainbows::Client < Kgio::Socket include Rainbows::ProcessClient + Rainbows.config!(self, :keepalive_timeout) def read_expire - Time.now + Rainbows.keepalive_timeout + Time.now + KEEPALIVE_TIMEOUT end def kgio_wait_readable - wait Rainbows.keepalive_timeout + wait KEEPALIVE_TIMEOUT end # used for reading headers (respecting keepalive_timeout) def timed_read(buf) expire = nil begin - case rv = kgio_tryread(HBUFSIZ, buf) + case rv = kgio_tryread(CLIENT_HEADER_BUFFER_SIZE, buf) when :wait_readable return if expire && expire < Time.now expire ||= read_expire |