diff --git a/examples/websockets.ru b/examples/websockets.ru index b74f93f..72a1524 100644 --- a/examples/websockets.ru +++ b/examples/websockets.ru @@ -13,6 +13,7 @@ class Test < Landline::App puts "Client closed read connection" end socket.write("Hi!") + puts IO.select([socket]).inspect while (response = socket.read) if response puts "Client wrote: #{response.inspect}" diff --git a/lib/landline/extensions/websocket.rb b/lib/landline/extensions/websocket.rb index 84f44d1..4d035bf 100644 --- a/lib/landline/extensions/websocket.rb +++ b/lib/landline/extensions/websocket.rb @@ -171,6 +171,12 @@ module Landline close_write if @writable end + # Obtain internal IO object + # @return [IO] + def to_io + io + end + attr_reader :io, :readable, :writable private