When I run servers like WEBrick or an instance of TCPServer, it's
unclear to me how to stop them, especially under Windows. Ctrl-C seems
to kill the server, but not the Ruby application in which it is
running. How can I detect that Ctrl-C has been pressed? Ctrl-Break
sends an INT signal that I can catch with trap('INT'). I'm not sure
what triggers trap('TERM'), but it's not Ctrl-C.

--
R. Mark Volkmann
Partner, Object Computing, Inc.