Commit 51f1e253 authored by Cool Fire's avatar Cool Fire

Warpped the whole thing in a try-catch as an extra failsafe

parent 105689f1
......@@ -41,6 +41,7 @@ end
# Main server loop
loop do
begin
# New client connected
client = server.accept
......@@ -48,6 +49,8 @@ loop do
input = client.gets
input.strip!
puts "Request: #{input}"
sane = true
p1 = 0
p2 = 0
......@@ -55,7 +58,7 @@ loop do
# Check if it's something that looks like an ident response
if( input =~ /^(\d+)(|\s),(|\s)(\d+)$/ )
p1 = $1.to_i
p2 = $3.to_i
p2 = $4.to_i
else
sane = false
end
......@@ -92,8 +95,11 @@ loop do
next
end
puts "Response: #{result}"
client.puts result
# Close connection and wait for the next request
client.close
rescue Exception => e
end
end
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment