Sha256: c1a5f9c30b2c9c4c07181f7e4967980a557662772b460485051fa3681f8e4204
Contents?: true
Size: 490 Bytes
Versions: 80
Compression:
Stored size: 490 Bytes
Contents
# frozen_string_literal: true require 'bundler/setup' require 'polyphony' require 'fileutils' unix_path = '/tmp/polyphony-unix-socket' FileUtils.rm unix_path rescue nil server = UNIXServer.new(unix_path) spin do server.accept_loop do |socket| p [:accept, socket] spin do while (line = socket.gets) socket.puts line end end end end snooze client = UNIXSocket.new('/tmp/polyphony-unix-socket') p [:connected, client] client.puts 'hello!' p client.gets
Version data entries
80 entries across 80 versions & 1 rubygems