Class: Netconf::IOProc
Constant Summary
collapse
- DEFAULT_RDBLKSZ =
(1024*1024)
Instance Attribute Summary collapse
Attributes inherited from Transport
#capabilities, #rpc, #session_id, #state, #timeout, #waitio
Instance Method Summary
collapse
Methods inherited from Transport
#close, #closed?, #has_capability?, #open, #open?, #rpc_exec, #send_and_receive
Constructor Details
#initialize(args_h = {}, &block) ⇒ IOProc
Returns a new instance of IOProc.
9
10
11
12
13
14
15
16
17
18
19
20
21
|
# File 'lib/net/netconf/ioproc.rb', line 9
def initialize( args_h = {}, &block )
os_type = args_h[:os_type] || Netconf::DEFAULT_OS_TYPE
@args = args_h.clone
extend Netconf::const_get( os_type )::IOProc
@trans_timeout = @args[:timeout] || Netconf::DEFAULT_TIMEOUT
@trans_waitio = @args[:waitio] || Netconf::DEFAULT_WAITIO
super( &block )
end
|
Instance Attribute Details
#args ⇒ Object
Returns the value of attribute args.
7
8
9
|
# File 'lib/net/netconf/ioproc.rb', line 7
def args
@args
end
|
Instance Method Details
#puts(str = nil) ⇒ Object
49
50
51
|
# File 'lib/net/netconf/ioproc.rb', line 49
def puts( str = nil )
@trans.puts( str )
end
|
#trans_open ⇒ Object
the OS specific transport must implement this method
24
25
26
|
# File 'lib/net/netconf/ioproc.rb', line 24
def trans_open raise "Unsupported IOProc"
end
|
#trans_receive_hello ⇒ Object
28
29
30
|
# File 'lib/net/netconf/ioproc.rb', line 28
def trans_receive_hello
trans_receive()
end
|
#trans_send(cmd_str) ⇒ Object
41
42
43
|
# File 'lib/net/netconf/ioproc.rb', line 41
def trans_send( cmd_str )
@trans.write( cmd_str )
end
|
#trans_send_hello ⇒ Object
32
33
34
|
# File 'lib/net/netconf/ioproc.rb', line 32
def trans_send_hello
nil
end
|
#waitfor(on_re) ⇒ Object
53
54
55
|
# File 'lib/net/netconf/ioproc.rb', line 53
def waitfor( on_re )
Netconf.waitfor(on_re)
end
|