Added ability to IO.select websockets
This commit is contained in:
parent
582b0c1341
commit
250254d2df
|
@ -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}"
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue