class Protocol::HTTP::Peer

Provide a well defined, cached representation of a peer (address).

def self.for(io)

@returns [Peer | Nil] The peer object, or nil if the remote address is not available.

Create a new peer object for the given IO object, using the remote address if available.
def self.for(io)
	if address = io.remote_address
		return new(address)
	end
end

def initialize(address)

@parameter address [Addrinfo] The remote address of the peer.

Initialize the peer with the given address.
def initialize(address)
	@address = address
	
	if address.ip?
		@ip_address = @address.ip_address
	end
end