Class: RIO::TCP::RL
Constant Summary collapse
- RIOSCHEME =
'tcp'.freeze
- SPLIT_RE =
must be able to process parse(‘rio:tcp’,host,port) parse(‘rio:tcp://host:port’)
%r|//([^/:]*):([0-9a-z]+)$|.freeze
Instance Attribute Summary collapse
-
#host ⇒ Object
readonly
Returns the value of attribute host.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(host, port) ⇒ RL
constructor
A new instance of RL.
- #opaque ⇒ Object
- #open(*args) ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(host, port) ⇒ RL
Returns a new instance of RL.
34 35 36 37 38 |
# File 'lib/rio/scheme/tcp.rb', line 34 def initialize(host,port) @host = host @port = port super end |
Instance Attribute Details
#host ⇒ Object (readonly)
Returns the value of attribute host.
33 34 35 |
# File 'lib/rio/scheme/tcp.rb', line 33 def host @host end |
Class Method Details
Instance Method Details
#opaque ⇒ Object
39 40 41 |
# File 'lib/rio/scheme/tcp.rb', line 39 def opaque() sprintf('//%s:%s',@host,@port) end |
#open(*args) ⇒ Object
43 44 45 |
# File 'lib/rio/scheme/tcp.rb', line 43 def open(*args) super(::TCPSocket.new(@host || 'localhost',@port)) end |
#to_s ⇒ Object
46 |
# File 'lib/rio/scheme/tcp.rb', line 46 def to_s() self.url end |