Project

General

Profile

Bug #9753 » simple_client.rb

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

 
#!/bin/ruby
=begin
simple client does two transactions and quits


=end

require 'socket'

sock = UNIXSocket.open("test_socket")

sock.puts "{\"cmd\":\"test_interface_to_interface\", \"iam\":\"simple_client\", \"tran\":\"1\"}"
reply = sock.gets
puts reply

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

sock.close
(3-3/5)