Sha256: 361afe7508e9a16ade4086a755af6fde4d3ec96d17970d11bd7e90e9e47391d9
Contents?: true
Size: 675 Bytes
Versions: 18
Compression:
Stored size: 675 Bytes
Contents
require 'socket' module ProconBypassMan::ProconDisplay class Server PORT = 9900 def self.start! Thread.new do new.start_with_foreground end end def initialize @server = TCPServer.new('0.0.0.0', PORT) end def start_with_foreground loop do conn = @server.accept response = ServerApp.new( HttpRequest.parse(conn).to_hash ).call conn.write(response) conn.close end rescue Errno::EADDRINUSE => e ProconBypassMan::SendErrorCommand.execute(error: e) rescue => e ProconBypassMan::SendErrorCommand.execute(error: e) retry end end end
Version data entries
18 entries across 18 versions & 1 rubygems