module Ethon::Multi::Operations

def socket_action(io = nil, readiness = 0)

Returns:
  • (Symbol) - The Curl.multi_socket_action return code.

Other tags:
    Example: When a socket is readable and writable -
    Example: When a socket is readable -
    Example: When no sockets are ready yet, or to begin. -
def socket_action(io = nil, readiness = 0)
  ensure_execution_mode(:socket_action)
  fd = if io.nil?
    ::Ethon::Curl::SOCKET_TIMEOUT
  elsif io.is_a?(Integer)
    io
  else
    io.fileno
  end
  code = Curl.multi_socket_action(handle, fd, readiness, @running_count_pointer)
  @running_count = @running_count_pointer.read_int
  check
  code
end