#include <cat/cat.h>
int catnet_getfd(cat_session *session, int fd_id, CATSOCK *sock);
fd_id is a single file descriptor and must not be a combination of several file descriptors.
*sock specifies where the socket descriptor will be stored. The socket is not affected by this operation. While the socket is in use by the session, it should not be used for any other purpose.
The function returns CAT_OK if successful, or a negative code on error.