Added ability to IO.select websockets

This commit is contained in:
Yessiest 2024-07-08 18:26:45 +04:00
parent 582b0c1341
commit 250254d2df
2 changed files with 7 additions and 0 deletions

View File

@ -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}"

View File

@ -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