class EventMachine::Selectable
@private
def close_scheduled?
def close_scheduled? @close_scheduled end
def get_peername
def get_peername nil end
def get_sockname
def get_sockname nil end
def heartbeat
def heartbeat end
def initialize io
def initialize io @io = io @uuid = UuidGenerator.generate @is_server = false @last_activity = Reactor.instance.current_loop_time if defined?(Fcntl::F_GETFL) m = @io.fcntl(Fcntl::F_GETFL, 0) @io.fcntl(Fcntl::F_SETFL, Fcntl::O_NONBLOCK | m) else # Windows doesn't define F_GETFL. # It's not very reliable about setting descriptors nonblocking either. begin s = Socket.for_fd(@io.fileno) s.fcntl( Fcntl::F_SETFL, Fcntl::O_NONBLOCK ) rescue Errno::EINVAL, Errno::EBADF warn "Serious error: unable to set descriptor non-blocking" end end # TODO, should set CLOEXEC on Unix? @close_scheduled = false @close_requested = false se = self; @io.instance_eval { @my_selectable = se } Reactor.instance.add_selectable @io end
def schedule_close(after_writing=false)
def schedule_close(after_writing=false) if after_writing @close_requested = true else @close_scheduled = true end end
def select_for_reading?
def select_for_reading? false end
def select_for_writing?
def select_for_writing? false end
def set_inactivity_timeout tm
def set_inactivity_timeout tm @inactivity_timeout = tm end