Module: Specjour::SocketHelpers
- Included in:
- Dispatcher, Manager, RsyncDaemon, Worker
- Defined in:
- lib/specjour/socket_helpers.rb
Instance Method Summary collapse
Instance Method Details
#hostname ⇒ Object
7 8 9 |
# File 'lib/specjour/socket_helpers.rb', line 7 def hostname @hostname ||= Socket.gethostname end |
#ip_from_hostname(hostname) ⇒ Object
3 4 5 |
# File 'lib/specjour/socket_helpers.rb', line 3 def ip_from_hostname(hostname) Socket.getaddrinfo(hostname, nil, Socket::AF_INET, Socket::SOCK_STREAM).first.fetch(3) end |