NNTP::Connection
Inherits NNTP::Connection::Pool < NNTP::Connection::Search < NNTP::Connection::Groups < NNTP::Connection::Context < NNTP::Connection::Articles < Reference < Object
Constants
Log = ::Log.for(self)
Constructors
connect(host, port = 119, use_ssl = true, verify_mode : OpenSSL::SSL::VerifyMode = OpenSSL::SSL::VerifyMode::PEER, open_timeout : Int32 = 30, read_timeout : Int32 = 60, user : String | Nil = nil, secret : String | Nil = nil, method = :original) : Connection
Will initialize a new Connection object, configure it, then establish a connection.
The created Connection will then be returned.
client = NNTP::Connection.connect("localhost", user: "myuser", pass: "mypass")
client.connected? # => true
new(uri : URI)
nntp://user:password@usenethost.com:443/?ssl=true&verify_mode=none&method=original
new(host, port = 119, use_ssl = true, verify_mode : String = "peer", open_timeout : Int32 = 30, read_timeout : Int32 = 60) : Connection
Sourcenew
SourceClass methods
connect(uri : URI)
SourceInstance methods
close
Sourceconfigure
Will yield self to provided block allow for variable setting.
Then create a new NNTP::Socket instance (without connecting) Will return self.
client = NNTP::Connection.new
client.configure do |c|
c.host = host
c.port = port
c.use_ssl = use_ssl
c.open_timeout = open_timeout
c.read_timeout = read_timeout
end
connect(user : String | Nil = nil, secret : String | Nil = nil, method = :original)
Will establish a NNTP::Socket connection using client setting and any authentication
params passed.
client = NNTP::Connection.new
client.connect("MyUSER", "SuperSecret")
connect(uri : URI)
Sourceconnected?
Returns true if a connection has been established and false if not.
client = NNTP::Connection.new
client.connected? # => false
client.connect
client.connected? # => true
host
Sourcehost=(host : String)
Sourceopen_timeout
Sourceopen_timeout=(open_timeout : Int32)
Sourceport
Sourceport=(port : Int32)
Sourceread_timeout
Sourceread_timeout=(read_timeout : Int32)
Sourceuse_ssl
Sourceuse_ssl=(use_ssl : Bool)
Sourceverify_mode
Sourceverify_mode=(verify_mode : OpenSSL::SSL::VerifyMode)
Sourcewith_socket
Source