Class: Ring::SQA::Poller

Inherits:
Object
  • Object
show all
Defined in:
lib/ring/sqa/poller.rb

Direct Known Subclasses

Receiver, Responder, Sender

Constant Summary collapse

MAX_READ =
500

Instance Method Summary collapse

Instance Method Details

#addressObject



7
8
9
# File 'lib/ring/sqa/poller.rb', line 7

def address
  CFG.afi == "ipv6" ? '::' : '0.0.0.0' # NAT 1:1 does not have expected address where we can bind
end

#portObject



11
12
13
# File 'lib/ring/sqa/poller.rb', line 11

def port
  CFG.port.to_i + ( CFG.afi == 'ipv6' ? 6 : 0 )
end

#udp_socketObject



15
16
17
# File 'lib/ring/sqa/poller.rb', line 15

def udp_socket
  CFG.afi == "ipv6" ? UDPSocket.new(Socket::AF_INET6) : UDPSocket.new
end