On 27.10.2010 17:05, Yan Bernatsky wrote:
> I have a problem with TCP server like this
>
> require "socket"
> server = TCPServer.open(2000)
> loop do
>    Thread.start(server.accept) do |client|
>      while msg = client.gets
>        sleep 10
>        client.puts "bye"
>      end
>    end
> end
>
> While server sleep if client breaking connection (hard break), server
> becomes invalid: he can accept connections, but can not puts to client
> any data and no exceptions return.
> Ruby 1.9.2
> What is happened?

You'll probably do not see the exception because you do not catch and 
handle it.  Try Thread.abort_on_exception = true at the beginning of the 
script to at least see the error.

Kind regards

	robert

-- 
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/