Sha256: 76b436fd65317310079e9a27340b62742a886ae93d5068399162c1ad639907af

Contents?: true

Size: 568 Bytes

Versions: 2

Compression:

Stored size: 568 Bytes

Contents

# encoding: utf-8

# request.rb

# This example is used in conjunction with reply.rb. Run this program in
# a terminal/console window and then run reply.rb in another terminal/console
# window and observe the output.
#
# Usage: ruby request.rb
#

require File.join(File.dirname(__FILE__), '..', 'lib', 'ffi-rxs')

ctx = XS::Context.create()
socket = ctx.socket(XS::REQ)
socket.connect("tcp://127.0.0.1:5000")
 
for i in 1..10
  msg = "msg #{i.to_s}"
  socket.send_string(msg)
  puts "Sending: " + msg
  socket.recv_string(msg_in = '')
  puts "Received: " + msg_in
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ffi-rxs-1.1.0 examples/request.rb
ffi-rxs-1.0.1 examples/request.rb