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