Reputation: 3428
I have a UNIX server started and the code goes like:
module UNIX_Server
def receive_data(data)
send_data "testing"
end
def unbind
puts "[server] client disconnected."
end
end
EM::run {
EM::start_unix_domain_server('/tmp/file.sock', UNIX_Server)
}
This works fine, and I am trying to connect to this using a Ruby 1.8.7 UNIX Socket:
s = UNIXSocket.new
s.puts "test"
s.gets
The problem here is that my gets method seems to hang and the client only gets data when I do a Ctrl-C and terminate the server. What am I missing here?
Upvotes: 2
Views: 762