# While terminating process

**URL:** <https://www.ruby-forum.com/t/while-terminating-process/62721>\
**Category:** Ruby\
**Created:** [June 7, 2006, 4:22pm UTC](https://www.ruby-forum.com/t/while-terminating-process/62721 "2006-06-07T16:22:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![stuartbrand](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/5f9b8f/32.png) [@stuartbrand](https://www.ruby-forum.com/u/stuartbrand)\
**Post date:** [June 7, 2006, 4:22pm UTC](https://www.ruby-forum.com/t/while-terminating-process/62721/1 "2006-06-07T16:22:18Z")

</div>

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) }  
end

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

Stuart
