Class: XS::LibXS::PollItem

Inherits:
FFI::Struct
  • Object
show all
Includes:
PollItemLayout
Defined in:
lib/ffi-rxs/libxs.rb

Overview

module PollItemLayout

Instance Method Summary collapse

Instance Method Details

#both_accessible?Boolean

Returns:

  • (Boolean)


147
148
149
# File 'lib/ffi-rxs/libxs.rb', line 147

def both_accessible?
  readable? && writable?
end

#fdObject



137
# File 'lib/ffi-rxs/libxs.rb', line 137

def fd() self[:fd]; end

#inspectObject



151
152
153
# File 'lib/ffi-rxs/libxs.rb', line 151

def inspect
  "socket [#{socket}], fd [#{fd}], events [#{self[:events]}], revents [#{self[:revents]}]"
end

#readable?Boolean

Returns:

  • (Boolean)


139
140
141
# File 'lib/ffi-rxs/libxs.rb', line 139

def readable?
  (self[:revents] & XS::POLLIN) > 0
end

#socketObject



135
# File 'lib/ffi-rxs/libxs.rb', line 135

def socket() self[:socket]; end

#to_sObject



155
# File 'lib/ffi-rxs/libxs.rb', line 155

def to_s; inspect; end

#writable?Boolean

Returns:

  • (Boolean)


143
144
145
# File 'lib/ffi-rxs/libxs.rb', line 143

def writable?
  (self[:revents] & XS::POLLOUT) > 0
end