diff options
author | Eric Wong <e@80x24.org> | 2013-10-26 04:00:59 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2013-10-26 04:02:18 +0000 |
commit | 1506dcd4741d64538bf6d822413219ddb1ec11c2 (patch) | |
tree | f3c54705c1a94e7f0750ccce3ce5fb3c24f095fa /lib/yahns/server.rb | |
parent | a224a0bbb16aeed9a1420c6a770e723cf30a28b3 (diff) | |
download | yahns-1506dcd4741d64538bf6d822413219ddb1ec11c2.tar.gz |
This should make things a little easier-to-follow and possibly improve method cache hit rates for servers with multiple acceptors.
Diffstat (limited to 'lib/yahns/server.rb')
-rw-r--r-- | lib/yahns/server.rb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/yahns/server.rb b/lib/yahns/server.rb index 8490c5a..9a72ef5 100644 --- a/lib/yahns/server.rb +++ b/lib/yahns/server.rb @@ -2,6 +2,8 @@ # Copyright (C) 2013, Eric Wong <normalperson@yhbt.net> and all contributors # License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt) require_relative 'queue_quitter' +require_relative 'tcp_server' +require_relative 'unix_server' class Yahns::Server # :nodoc: QUEUE_SIGS = [ :WINCH, :QUIT, :INT, :TERM, :USR1, :USR2, :HUP, :TTIN, :TTOU, @@ -162,7 +164,7 @@ class Yahns::Server # :nodoc: begin io = bind_listen(address, sock_opts(address)) - unless Kgio::TCPServer === io || Kgio::UNIXServer === io + unless Yahns::TCPServer === io || Yahns::UNIXServer === io io = server_cast(io) end @logger.info "listening on addr=#{sock_name(io)} fd=#{io.fileno}" @@ -282,7 +284,7 @@ class Yahns::Server # :nodoc: def inherit_listeners! # inherit sockets from parents, they need to be plain Socket objects - # before they become Kgio::UNIXServer or Kgio::TCPServer + # before they become Yahns::UNIXServer or Yahns::TCPServer inherited = ENV['YAHNS_FD'].to_s.split(/,/).map do |fd| io = Socket.for_fd(fd.to_i) set_server_sockopt(io, sock_opts(io)) @@ -298,7 +300,6 @@ class Yahns::Server # :nodoc: def bind_new_listeners! self.listeners = @config.config_listeners.keys raise ArgumentError, "no listeners" if @listeners.empty? - @listeners.each { |l| l.extend(Yahns::Acceptor) } end def proc_name(tag) |