Sha256: dd57f8247793672baacff5964a58cc799d091731daa4803dd900887f59153bf0

Contents?: true

Size: 453 Bytes

Versions: 7

Compression:

Stored size: 453 Bytes

Contents

#!/usr/bin/env ruby
# frozen_string_literal: true

$LOAD_PATH.unshift File.expand_path("../../lib", __dir__)

require 'async'
require 'async/io/trap'
require 'async/io/host_endpoint'
require 'async/io/stream'

endpoint = Async::IO::Endpoint.tcp('localhost', 4578)

Async do |task|
	endpoint.connect do |peer|
		stream = Async::IO::Stream.new(peer)
		
		while true
			task.sleep 1
			stream.puts "Hello World!"
			puts stream.gets.inspect
		end
	end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
async-io-1.29.0 examples/echo/client.rb
async-io-1.28.0 examples/echo/client.rb
async-io-1.27.7 examples/echo/client.rb
async-io-1.27.6 examples/echo/client.rb
async-io-1.27.5 examples/echo/client.rb
async-io-1.27.4 examples/echo/client.rb
async-io-1.27.3 examples/echo/client.rb