Class: Mongo::Address::IPv4
Relationships & Source Files | |
Inherits: | Object |
Defined in: | lib/mongo/address/ipv4.rb |
Overview
Sets up resolution with IPv4
support if the address is an ip address.
Constant Summary
-
MATCH =
The regular expression to use to match an
IPv4
ip address.Regexp.new('/\./').freeze
-
SPLIT =
Split value constant.
':'.freeze
Class Method Summary
-
.new(host, port, host_name = nil) ⇒ IPv4
constructor
Initialize the
IPv4
resolver. -
.parse(address) ⇒ Array<String, Integer>
Parse an
IPv4
address into its host and port.
Instance Attribute Summary
- #host ⇒ String readonly
- #host_name ⇒ String readonly
- #port ⇒ Integer readonly
Instance Method Summary
-
#socket(socket_timeout, options = {}) ⇒ Mongo::Socket::SSL, Mongo::Socket::TCP
Internal use only
Internal use only
Get a socket for the provided address type, given the options.
Constructor Details
.new(host, port, host_name = nil) ⇒ IPv4
Initialize the IPv4
resolver.
Class Method Details
.parse(address) ⇒ Array
<String
, Integer
>
Parse an IPv4
address into its host and port.
Instance Attribute Details
#host ⇒ String
(readonly)
# File 'lib/mongo/address/ipv4.rb', line 28
attr_reader :host
#host_name ⇒ String
(readonly)
# File 'lib/mongo/address/ipv4.rb', line 31
attr_reader :host_name
#port ⇒ Integer
(readonly)
# File 'lib/mongo/address/ipv4.rb', line 34
attr_reader :port
Instance Method Details
#socket(socket_timeout, options = {}) ⇒ Mongo::Socket::SSL, Mongo::Socket::TCP
This method is for internal use only.
Get a socket for the provided address type, given the options.