method
do_start
v2_4_6 -
Show latest stable
- Class:
Net::POP3
do_start(account, password)private
internal method for Net::POP3.start
# File lib/net/pop.rb, line 543
def do_start(account, password) # :nodoc:
s = Timeout.timeout(@open_timeout, Net::OpenTimeout) do
TCPSocket.open(@address, port)
end
if use_ssl?
raise 'openssl library not installed' unless defined?(OpenSSL)
context = OpenSSL::SSL::SSLContext.new
context.set_params(@ssl_params)
s = OpenSSL::SSL::SSLSocket.new(s, context)
s.sync_close = true
s.connect
if context.verify_mode != OpenSSL::SSL::VERIFY_NONE
s.post_connection_check(@address)
end
end
@socket = InternetMessageIO.new(s,
read_timeout: @read_timeout,
debug_output: @debug_output)
logging "POP session started: #{@address}:#{@port} (#{@apop ? 'APOP' : 'POP'})"
on_connect
@command = POP3Command.new(@socket)
if apop?
@command.apop account, password
else
@command.auth account, password
end
@started = true
ensure
# Authentication failed, clean up connection.
unless @started
s.close if s
@socket = nil
@command = nil
end
end Related methods
- Instance methods
- active?
- apop?
- auth_only
- delete_all
- disable_ssl
- each
- each_mail
- enable_ssl
- finish
- inspect
- logging
- mails
- n_bytes
- n_mails
- port
- read_timeout=
- reset
- set_all_uids
- set_debug_output
- start
- started?
- use_ssl?
- Class methods
- APOP
- auth_only
- certs
- create_ssl_params
- default_pop3_port
- default_pop3s_port
- default_port
- delete_all
- disable_ssl
- enable_ssl
- foreach
- new
- socket_type
- ssl_params
- start
- use_ssl?
- verify
- Private methods
-
command -
do_finish -
do_start -
on_connect