If using Unix Sockets, and you want to use SO_PEERCRED, you can use the number 17 for the optname (and SOL_SOCKET for the level). The PID of the connecting process will be returned.
socket_get_option
(PHP 4 >= 4.3.0, PHP 5)
socket_get_option — Pega opções de socket para o socket
Descrição
Aviso
Esta função é EXPERIMENTAL. O comportamento desta função, seu nome, incluindo toda documentação pode ser modificado sem aviso em futuras versões do PHP. Esta função deve ser usada por sua própria conta e risco.
Aviso
Esta função não está documentada; somente a lista de argumentos está disponível.
Nota:
Essa função é para ser usada chamando socket_getopt() primeiramente para PHP 4.3.0
Chad Lavoie ¶
2 years ago
recycling dot sp dot am at gmail dot com ¶
2 years ago
Just 2 notes here:
- On UNIX, If SO_DEBUG is set, the php program needs an effective user id of 0.
- activating SO_OOBINLINE on a socket is equivalent to passing MSG_OOB flag to each recieving functions used with that socket (eg: socket_recv, socket_recvfrom).
