Skip to content
instance method

UNIXSocket#peeraddr

() -> [ ::String, ::String ]
unixsocket.peeraddr => [address_family, unix_path]

Returns the remote address as an array which contains address_family and unix_path.

Example

Example
serv = UNIXServer.new("/tmp/sock")
c = UNIXSocket.new("/tmp/sock")
p c.peeraddr #=> ["AF_UNIX", "/tmp/sock"]
See also #path #recvfrom #addr #recv_io also in 4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0