Sha256: ce3c0692bb41ac7f1a88828f37699e870f64b248f964c32c8d94c8954def2fc5

Contents?: true

Size: 354 Bytes

Versions: 6

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_to_eof_from(conn) }
  spin { conn.splice_to_eof_from(buffer) }
end

puts "Serving echo on port 1234..."
TCPServer.new('127.0.0.1', 1234).accept_loop { |c| handle_echo_client(c) }

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
polyphony-0.91 examples/io/splice_echo_server.rb
polyphony-0.90 examples/io/splice_echo_server.rb
polyphony-0.89 examples/io/splice_echo_server.rb
polyphony-0.87 examples/io/splice_echo_server.rb
polyphony-0.86 examples/io/splice_echo_server.rb
polyphony-0.85 examples/io/splice_echo_server.rb