Sha256: 4cd41a0dadf3a3dc369d74be16011f0dd8c48da28f2f959bea84e42924d2c838

Contents?: true

Size: 423 Bytes

Versions: 4

Compression:

Stored size: 423 Bytes

Contents

#!/usr/bin/env ruby

$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

4 entries across 4 versions & 1 rubygems

Version Path
async-io-1.27.2 examples/echo/client.rb
async-io-1.27.1 examples/echo/client.rb
async-io-1.27.0 examples/echo/client.rb
async-io-1.26.0 examples/echo/client.rb