Sha256: a4a2e09fd845fd057aecc367417419623e32e64ddf9b0e3b5ab8361261ca5e38
Contents?: true
Size: 354 Bytes
Versions: 25
Compression:
Stored size: 354 Bytes
Contents
# frozen_string_literal: true require 'bundler/setup' require 'polyphony' require 'polyphony' def handle_echo_client(conn) buffer = Polyphony.pipe spin { buffer.splice_from(conn, -1000) } spin { conn.splice_from(buffer, -1000) } end puts "Serving echo on port 1234..." TCPServer.new('127.0.0.1', 1234).accept_loop { |c| handle_echo_client(c) }
Version data entries
25 entries across 25 versions & 1 rubygems