Module: RSwim

Defined in:
lib/rswim.rb,
lib/rswim/node.rb,
lib/rswim/pipe.rb,
lib/rswim/agent.rb,
lib/rswim/logger.rb,
lib/rswim/io_loop.rb,
lib/rswim/message.rb,
lib/rswim/version.rb,
lib/rswim/directory.rb,
lib/rswim/member/me.rb,
lib/rswim/encryption.rb,
lib/rswim/member/base.rb,
lib/rswim/member/peer.rb,
lib/rswim/member_pool.rb,
lib/rswim/update_entry.rb,
lib/rswim/status_report.rb,
lib/rswim/protocol_state.rb,
lib/rswim/integration/udp/node.rb,
lib/rswim/member/ack_responder.rb,
lib/rswim/integration/udp/sender.rb,
lib/rswim/integration/udp/io_loop.rb,
lib/rswim/member/health_state/base.rb,
lib/rswim/member/health_state/alive.rb,
lib/rswim/member/forwarding_state/base.rb,
lib/rswim/member/forwarding_state/ready.rb,
lib/rswim/member/health_state/confirmed.rb,
lib/rswim/member/health_state/suspected.rb,
lib/rswim/member/transmission_state/off.rb,
lib/rswim/member/transmission_state/base.rb,
lib/rswim/member/transmission_state/ready.rb,
lib/rswim/serialization/simple/serializer.rb,
lib/rswim/serialization/simple/deserializer.rb,
lib/rswim/serialization/encrypted/serializer.rb,
lib/rswim/serialization/encrypted/deserializer.rb,
lib/rswim/member/forwarding_state/forwarding_ack.rb,
lib/rswim/member/transmission_state/awaiting_ack.rb,
lib/rswim/member/transmission_state/sending_ping.rb,
lib/rswim/member/transmission_state/sending_ping_request.rb

Defined Under Namespace

Modules: Agent, Encryption, Integration, Member Classes: Directory, Error, IOLoop, Logger, MemberPool, Message, Node, Pipe, ProtocolState, StatusReport, UpdateEntry

Constant Summary collapse

K =
3
T_MS =

Protocol time, millis

30_000
R_MS =

Roundtrip time, millis

10_000
VERSION =
'2.2.0'

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.encryptedObject

Returns the value of attribute encrypted.



41
42
43
# File 'lib/rswim.rb', line 41

def encrypted
  @encrypted
end

.shared_secretObject

Returns the value of attribute shared_secret.



41
42
43
# File 'lib/rswim.rb', line 41

def shared_secret
  @shared_secret
end

Class Method Details

.validate_config!Object



43
44
45
46
# File 'lib/rswim.rb', line 43

def validate_config!
  validate_shared_secret! if @encrypted
  true
end

.validate_shared_secret!Object

Raises:



48
49
50
51
# File 'lib/rswim.rb', line 48

def validate_shared_secret!
  raise Error, 'Encrypted mode was set, but no shared secret configured' if @shared_secret.nil?
  raise Error, 'Shared secret too short' if @shared_secret.length < 8
end