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

Version Path
polyphony-1.6 examples/io/splice_echo_server.rb
polyphony-1.5 examples/io/splice_echo_server.rb
polyphony-1.4 examples/io/splice_echo_server.rb
polyphony-1.3 examples/io/splice_echo_server.rb
polyphony-1.2.1 examples/io/splice_echo_server.rb
polyphony-1.2 examples/io/splice_echo_server.rb
polyphony-1.1.1 examples/io/splice_echo_server.rb
polyphony-1.1 examples/io/splice_echo_server.rb
polyphony-1.0.2 examples/io/splice_echo_server.rb
polyphony-1.0.1 examples/io/splice_echo_server.rb
polyphony-1.0 examples/io/splice_echo_server.rb
polyphony-0.99.6 examples/io/splice_echo_server.rb
polyphony-0.99.5 examples/io/splice_echo_server.rb
polyphony-0.99.4 examples/io/splice_echo_server.rb
polyphony-0.99.3 examples/io/splice_echo_server.rb
polyphony-0.99.2 examples/io/splice_echo_server.rb
polyphony-0.99.1 examples/io/splice_echo_server.rb
polyphony-0.99 examples/io/splice_echo_server.rb
polyphony-0.98 examples/io/splice_echo_server.rb
polyphony-0.97 examples/io/splice_echo_server.rb