From: mark shennce Date: 2004-09-13T04:49:58+09:00 Subject: Re: UDPSocket - script crash mark shennce wrote: > hello, > > if there is no peer for this udp socket which > was created with > > $sock = UDPSocket.new > > the script crash with the message > 'connection was closed by peer'. > > How to avoid this crash? > > def Send str > begin > $sock.send(str, 0, "127.0.0.1", 9999) # *** crash if no peer... > rescue Exception > p "Oops" # was never called > end > > $trace.insert(0.0, sprintf("=> %s", str)) > end > > > mark yeah, I use ruby 1.8.1 and winnt m