I've observed (and expanded upon) a slightly naughty use case of
apr_socket_t in the Ganglia code base

Specifically, Ganglia tries to get the raw socket and use it for a
couple of things like getsockopt, as apr_getsockopt doesn't seem to work
on older apr versions:

http://www.mail-archive.com/[email protected]/msg06179.html

So we do this little trick, defining the struct in our own code:

https://github.com/ganglia/monitor-core/blob/master/lib/apr_net.c#L20

More recently, I wanted to add optional TLS support to dynalogin.  It
also uses APR sockets.  I repeated the same trick, but I'd prefer to
find a more elegant solution than:

https://github.com/dynalogin/dynalogin/blob/master/dynalogind/dynalogind.c#L429
 (accessing socketdes)

Can anyone comment on this?  In particular, how to get the socket, or
how to make TLS work with APR in some other way?

Reply via email to