class

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
Source
new(uri : URI)

nntp://user:password@usenethost.com:443/?ssl=true&verify_mode=none&method=original

Source
new(host, port = 119, use_ssl = true, verify_mode : String = "peer", open_timeout : Int32 = 30, read_timeout : Int32 = 60) : Connection
Source

Class methods

connect(uri : URI)
Source

Instance methods

close
Source
configure

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
Source
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")
Source
connect(uri : URI)
Source
connected?

Returns true if a connection has been established and false if not.

client = NNTP::Connection.new
client.connected? # => false
client.connect
client.connected? # => true
Source
host
Source
host=(host : String)
Source
open_timeout
Source
open_timeout=(open_timeout : Int32)
Source
port
Source
port=(port : Int32)
Source
read_timeout
Source
read_timeout=(read_timeout : Int32)
Source
use_ssl
Source
use_ssl=(use_ssl : Bool)
Source
verify_mode
Source
verify_mode=(verify_mode : OpenSSL::SSL::VerifyMode)
Source
with_socket
Source

Nested types