Subject: Re: [boost] Get PID from local socket?
From: Rutger ter Borg (rutger_at_[hidden])
Date: 2010-11-01 03:42:05
On 2010-10-31 21:17, Rush Manbert wrote:
> I am using boost ASIO to do socket communications between an app and a daemon running on the same machine. The communications go through a Unix Domain Socket on the Mac and a named pipe on Windows. I'm looking for a way that the client app could obtain the PID of the daemon process, starting with the connected socket. I have tried calling local_endpoint() and remote_endpoint(), but the only information there seems to be the socket path (at least on the Mac). My google searches have turned up nothing, and they actually suggest that there is no way to achieve this on the Mac, even if I were using the "normal" socket API. Does anyone know whether this is possible and how to do it?
use getpid() and send it over the connected sockets during the handshake?
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk