ipcd/src/lib/io.cr

22 lines
478 B
Crystal

require "http"
require "http/web_socket/protocol"
# The Socket library uses the IO::Buffered module.
# IO::Buffered needs a new function to check if there is still something to read
# in its buffer. Since WebSocket is compatible with all IO instances, then IO
# needs this function as well, even if it doesn't really makes sense here.
class IO
def empty? : Bool
true
end
end
module IO::Buffered
# :nodoc:
def empty? : Bool
@in_buffer_rem.size == 0
end
end