[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: TCPSocket hangs after ctrl-c

e

1/16/2005 3:26:00 PM

> Lähettäjä: Bjarke Bruun <bbj@swooplinux.org>
> Aihe: TCPSocket hangs after ctrl-c
>
> Hi there,
>
> I'm new on the list and have tried google for help first, with no luck.
>
> I'm writing a small tcpserver and when I debug it and make changes I
> have to stop the server and I get a hanging socket
>
> $ netstat -atn
> <SNIP>
> tcp 0 0 127.0.0.1:10000 127.0.0.1:44420
> TIME_WAIT
> </SNIP>
>
> It hangs for apx. 30 secunds, not that I can't wait, but... when making
> smalle incremeltal changes all the time in the debugging process it
> becomes very tedious.
>
> So, is there any way to send a proper kill signal to a runing ruby
> script that will run an at_exit() function or the like so it'll shut
> down cleanly?

You could try Signal#trap. Or kill -9 :) What are you doing, though?
Are you trying to kill the process or restart it? In the latter case,
you may want to make sure that you have REUSEADDR turned on.

E