class Heartbeat

Public Class Methods

check(addr:, ctx:, type:, debug: false) click to toggle source
# File lib/rpareia/heartbeat.rb, line 2
def self.check(addr:, ctx:, type:, debug: false)
  if(type == 'client')
    hb = ctx.socket(:REQ)
    hb.verbose = debug
    hb.connect(addr)
    hb.send("")
    hb.close
  else
    hb = ctx.socket(:REP)
    hb.verbose = debug
    hb.bind(addr)
    hb.recv
    hb.close
  end
end