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"
|
puts "Client closed read connection"
|
||||||
end
|
end
|
||||||
socket.write("Hi!")
|
socket.write("Hi!")
|
||||||
|
puts IO.select([socket]).inspect
|
||||||
while (response = socket.read)
|
while (response = socket.read)
|
||||||
if response
|
if response
|
||||||
puts "Client wrote: #{response.inspect}"
|
puts "Client wrote: #{response.inspect}"
|
||||||
|
|
|
@ -171,6 +171,12 @@ module Landline
|
||||||
close_write if @writable
|
close_write if @writable
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Obtain internal IO object
|
||||||
|
# @return [IO]
|
||||||
|
def to_io
|
||||||
|
io
|
||||||
|
end
|
||||||
|
|
||||||
attr_reader :io, :readable, :writable
|
attr_reader :io, :readable, :writable
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
Loading…
Reference in New Issue