From: "Jesús Gabriel y Galán" Date: 2010-12-07T17:48:05+09:00 Subject: Re: Vortex Level0 with Ruby On Tue, Dec 7, 2010 at 9:29 AM, Eugeni Akmuradov wrote: > thanx, but i also dont't get this part > >> class Socket >> def self.open(*args) # 'cuz I don't like ugly >> f = self.class.new(*args) >> yield f >> f.close >> end >> end > is it absolutely necessary ? It's not necessary. It's a convenience method (similar to File#open) so that you don't need to explicitly close the socket after you are finished with it. In order to be more robust, the usual thing is to close the socket in an ensure block, so that even if there's an exception, the socket gets closed. Jesus.