Subject: [boost] Get PID from local socket?
From: Rush Manbert (rush_at_[hidden])
Date: 2010-10-31 16:17:37
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?
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk