Module: Reel::ConnectionMixin

Included in:
Connection, WebSocket
Defined in:
lib/reel/mixins.rb

Instance Method Summary collapse

Instance Method Details

#remote_hostObject

Obtain the hostname of the remote connection



18
19
20
21
# File 'lib/reel/mixins.rb', line 18

def remote_host
  # NOTE: Celluloid::IO does not yet support non-blocking reverse DNS
  socket.peeraddr(true)[2]
end

#remote_ipObject Also known as: remote_addr

Obtain the IP address of the remote connection



12
13
14
# File 'lib/reel/mixins.rb', line 12

def remote_ip
  socket.peeraddr(false)[3]
end