Project

General

Profile

Bug #9753 » simple_client_slow.rb

ThomasWLynch (Thomas Lynch), 04/17/2014 10:23 AM

 
#!/bin/ruby
=begin
simple client does two transactions, though it is a little slow about the pulling the data off the socket

fun this indpenedent of other clients, and it works fine, run it while another runs and it hangs

=end

require 'socket'

sock = UNIXSocket.open("test_socket")

sock.puts "{\"cmd\":\"test_client_to_interface\", \"iam\":\"stupid_client_slow\", \"tran\":\"1\"}"
sleep 5
reply = sock.gets
puts reply

sock.puts "{\"cmd\":\"test_client_to_interface\", \"iam\":\"stupid_client_slow\", \"tran\":\"2\"}"
reply = sock.gets
puts reply

sock.close
(2-2/5)