From: "Iñaki Baz Castillo" Date: 2008-03-28T02:31:26+09:00 Subject: How to kill a Thread into GServer "def server(io)" method? Hi, I'm using GServer and in "serve" method I read a string from a TCP socket: line = io.gets("\n") but it can occur that the TCP connection is closed so "gets" return NIL. In this case I just one to terminate this thread, no more. The only way I get it working is doing: line = io.gets("\n") Thread.current.terminate if !line # terminate = kill = exit Is it the appropiate way? I read the method doc but don't understand what exactly it does: thr.terminate Terminates thr and schedules another thread to be run, returning the terminated Thread. If this is the main thread, or the last thread, exits the process. Thanks for any explanation. -- Iñaki Baz Castillo