From: jjenning@... (jared l. jennings) Date: 2001-07-06T04:59:52+09:00 Subject: [ruby-talk:17344] Re: UNIX Sockets On Fri, Jul 06, 2001 at 04:45:29AM +0900, Manuel Zabelt wrote: > require 'socket' > > $path= "/tmp/ruby-socket-file" > > sThread = Thread.start{ > sock = UNIXServer.open($path) > s1 = sock.accept > p s1.recvfrom(124) > } > > client = UNIXSocket.open($path); > client.send("hello",0) > client.close > > sThread.join > > > First time I execute it: > > ["hello", ["AF_UNIX", "\277\277\316b\030("]] > > Second time I try it: > > socket.rb:11:in `open': Connection refused - "/tmp/ruby-socket-file" > (Errno::ECONNREFUSED) > from socket.rb:11 > > Is this normal behavior? How can I solve this? > did you check after it finished to see if there was a pipe laying around? because you never closed the UNIXServer.