Sha256: 9742da4300c648eed79f12fb84735e230efcda21740e7ef98b1f8d9e494d877d
Contents?: true
Size: 550 Bytes
Versions: 14
Compression:
Stored size: 550 Bytes
Contents
require 'bundler/setup' require 'celluloid/io' class EchoUNIXClient include Celluloid::IO finalizer :finalize def initialize(socket_path) puts "*** connecting to #{socket_path}" @socket_path = socket_path @socket = UNIXSocket.open(socket_path) end def echo(msg) puts "*** send to server: '#{msg}'" @socket.puts(msg) data = @socket.readline.chomp puts "*** server unswer '#{data}'" data end def finalize @socket.close if @socket end end c = EchoUNIXClient.new("/tmp/sock_test") c.echo("DATA")
Version data entries
14 entries across 14 versions & 1 rubygems