Class: VHSKit::Server

Inherits:
Object
  • Object
show all
Defined in:
lib/vhskit/server.rb

Instance Method Summary collapse

Constructor Details

#initialize(port, conf) ⇒ Server

Returns a new instance of Server.



7
8
9
10
# File 'lib/vhskit/server.rb', line 7

def initialize(port, conf)
  @serv = TCPServer.new port
  @conf = conf
end

Instance Method Details

#runObject



12
13
14
15
16
17
18
19
# File 'lib/vhskit/server.rb', line 12

def run
  while true
    sock = @serv.accept
    Thread.start do
      VHSKit::Handler.new(sock, @conf).run
    end
  end
end