Class: CIMD::Connection
- Inherits:
-
Object
- Object
- CIMD::Connection
- Defined in:
- lib/cimd_structures.rb
Instance Attribute Summary collapse
-
#alpha_orig_address ⇒ Object
Returns the value of attribute alpha_orig_address.
-
#keep_alive ⇒ Object
Returns the value of attribute keep_alive.
-
#packet_number ⇒ Object
Returns the value of attribute packet_number.
-
#password ⇒ Object
Returns the value of attribute password.
-
#port ⇒ Object
Returns the value of attribute port.
-
#server ⇒ Object
Returns the value of attribute server.
-
#user_identity ⇒ Object
Returns the value of attribute user_identity.
-
#window_size ⇒ Object
Returns the value of attribute window_size.
Instance Method Summary collapse
-
#initialize(server, port, user_identity, password, alpha_orig_address, window_size, keep_alive) ⇒ Connection
constructor
A new instance of Connection.
- #packet_number! ⇒ Object
- #packet_number? ⇒ Boolean
- #to_s ⇒ Object
Constructor Details
#initialize(server, port, user_identity, password, alpha_orig_address, window_size, keep_alive) ⇒ Connection
Returns a new instance of Connection.
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/cimd_structures.rb', line 14 def initialize(server,port,user_identity,password,alpha_orig_address,window_size,keep_alive) @server = server @port = port @user_identity = user_identity @password = password @keep_alive = keep_alive @packet_number = 1 @alpha_orig_address = alpha_orig_address @window_size = window_size end |
Instance Attribute Details
#alpha_orig_address ⇒ Object
Returns the value of attribute alpha_orig_address.
12 13 14 |
# File 'lib/cimd_structures.rb', line 12 def alpha_orig_address @alpha_orig_address end |
#keep_alive ⇒ Object
Returns the value of attribute keep_alive.
9 10 11 |
# File 'lib/cimd_structures.rb', line 9 def keep_alive @keep_alive end |
#packet_number ⇒ Object
Returns the value of attribute packet_number.
10 11 12 |
# File 'lib/cimd_structures.rb', line 10 def packet_number @packet_number end |
#password ⇒ Object
Returns the value of attribute password.
8 9 10 |
# File 'lib/cimd_structures.rb', line 8 def password @password end |
#port ⇒ Object
Returns the value of attribute port.
6 7 8 |
# File 'lib/cimd_structures.rb', line 6 def port @port end |
#server ⇒ Object
Returns the value of attribute server.
5 6 7 |
# File 'lib/cimd_structures.rb', line 5 def server @server end |
#user_identity ⇒ Object
Returns the value of attribute user_identity.
7 8 9 |
# File 'lib/cimd_structures.rb', line 7 def user_identity @user_identity end |
#window_size ⇒ Object
Returns the value of attribute window_size.
11 12 13 |
# File 'lib/cimd_structures.rb', line 11 def window_size @window_size end |
Instance Method Details
#packet_number! ⇒ Object
33 34 35 36 37 |
# File 'lib/cimd_structures.rb', line 33 def packet_number! f = @packet_number (@packet_number += 2) > 255 ? @packet_number = 1 : @packet_number return f end |
#packet_number? ⇒ Boolean
29 30 31 |
# File 'lib/cimd_structures.rb', line 29 def packet_number? return @packet_number end |
#to_s ⇒ Object
25 26 27 |
# File 'lib/cimd_structures.rb', line 25 def to_s return sprintf "\n\n*** Connection object:\nServer: %s\n,Port: %s\n,User identity: %s\nPassword: %s\nKeep Alive: %3d\nAlpha Orig Address: %s\n Packet number: %d\n\n",@server,@port,@user_identity,@password,@keep_alive,@alpha_orig_address,@packet_number end |