module KRPC

Constants

TypeStore
VERSION

Public Class Methods

connect(*args, &block) click to toggle source

Connect to a kRPC server, generate services API and return Client object. If the block is given, then it's called passing Client object and the connection to kRPC server is closed at the end of the block.

# File lib/krpc.rb, line 11
def connect(*args, &block)
  Client.new(*args).connect!(&block)
end

Public Instance Methods

call_block_and_close(block) click to toggle source
# File lib/krpc/client.rb, line 221
def call_block_and_close(block)
  begin block.call(self) ensure close end
end
receive_result() click to toggle source
# File lib/krpc/client.rb, line 215
def receive_result
  resp = rpc_connection.receive_message PB::Response
  raise build_exception(resp.error) unless resp.field_empty? :error
  resp.results[0]
end
send_request(service, procedure, args, kwargs, param_names, param_types, param_default) click to toggle source
# File lib/krpc/client.rb, line 210
def send_request(service, procedure, args, kwargs, param_names, param_types, param_default)
  req = build_request(service, procedure, args, kwargs, param_names, param_types, param_default)
  rpc_connection.send_message req
end