class Net::SMTP

Public Instance Methods

bind_at(ip) click to toggle source
# File lib/rhcf/utils/email.rb, line 10
def bind_at(ip)
  @bind_at = ip
end
socket() click to toggle source
# File lib/rhcf/utils/email.rb, line 6
def socket
  @socket
end
tcp_socket(address, port) click to toggle source
# File lib/rhcf/utils/email.rb, line 14
def tcp_socket(address, port)
  in_addr = Socket.pack_sockaddr_in(0, @bind_at) if @bind_at

  out_addr = Socket.pack_sockaddr_in(port, address)
  s = Socket.new(Socket::AF_INET, Socket::SOCK_STREAM, 0)
  s.bind(in_addr) if @bind_at
  s.connect(out_addr)
  s
end