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.
45 46 47 48 49 |
# File 'lib/rio/scheme/tcp.rb', line 45 def initialize(host,port) @host = host @port = port super end |
Instance Attribute Details
#host ⇒ Object (readonly)
Returns the value of attribute host.
44 45 46 |
# File 'lib/rio/scheme/tcp.rb', line 44 def host @host end |
Class Method Details
Instance Method Details
#opaque ⇒ Object
50 51 52 |
# File 'lib/rio/scheme/tcp.rb', line 50 def opaque() sprintf('//%s:%s',@host,@port) end |
#open(*args) ⇒ Object
54 55 56 57 |
# File 'lib/rio/scheme/tcp.rb', line 54 def open(*args) # @host = 'localhost' if @host.nil? or @host.empty? super(::TCPSocket.new(@host || 'localhost',@port)) end |
#to_s ⇒ Object
58 |
# File 'lib/rio/scheme/tcp.rb', line 58 def to_s() self.url end |