While terminating process

Hi all

I have writing a program that servers http, very simple, however, if
left for sometime idle the program terminates without error, it is
running a while loop, snip below

while (session = server.accept)
Thread.new { Send_html.handle_connection(session) }

No connections and just looping, then just randomly stops

I start the process from the command line by

ruby http-server 81 &

I get a pid as I would any program, i works fine, then left alone for a
few hours and exits by its self

Many thanks