Next: , Up: microhttpd-info   [Contents][Index]


12.1 Obtaining state information about an MHD daemon

Function: const union MHD_DaemonInfo * MHD_get_daemon_info (struct MHD_Daemon *daemon, enum MHD_DaemonInfoType infoType, ...)

Obtain information about the given daemon. This function is currently not fully implemented.

daemon

the daemon about which information is desired;

infoType

type of information that is desired

...

additional arguments about the desired information (depending on infoType)

Returns a union with the respective member (depending on infoType) set to the desired information), or NULL in case the desired information is not available or applicable.

Enumeration: MHD_DaemonInfoType

Values of this enum are used to specify what information about a daemon is desired.

MHD_DAEMON_INFO_KEY_SIZE

Request information about the key size for a particular cipher algorithm. The cipher algorithm should be passed as an extra argument (of type ’enum MHD_GNUTLS_CipherAlgorithm’). No longer supported, using this value will cause MHD_get_daemon_info to return NULL.

MHD_DAEMON_INFO_MAC_KEY_SIZE

Request information about the key size for a particular cipher algorithm. The cipher algorithm should be passed as an extra argument (of type ’enum MHD_GNUTLS_HashAlgorithm’). No longer supported, using this value will cause MHD_get_daemon_info to return NULL.

MHD_DAEMON_INFO_LISTEN_FD

Request the file-descriptor number that MHD is using to listen to the server socket. This can be useful if no port was specified and a client needs to learn what port is actually being used by MHD. No extra arguments should be passed.

MHD_DAEMON_INFO_EPOLL_FD

Request the file-descriptor number that MHD is using for epoll. If the build is not supporting epoll, NULL is returned; if we are using a thread pool or this daemon was not started with MHD_USE_EPOLL, (a pointer to) -1 is returned. If we are using MHD_USE_INTERNAL_POLLING_THREAD or are in ’external’ select mode, the internal epoll FD is returned. This function must be used in external select mode with epoll to obtain the FD to call epoll on. No extra arguments should be passed.

MHD_DAEMON_INFO_CURRENT_CONNECTIONS

Request the number of current connections handled by the daemon. No extra arguments should be passed and a pointer to a union MHD_DaemonInfo value is returned, with the num_connections member of type unsigned int set to the number of active connections.

Note that in multi-threaded or internal-select mode, the real number of current connections may already be different when MHD_get_daemon_info returns. The number of current connections can be used (even in multi-threaded and internal-select mode) after MHD_quiesce_daemon to detect whether all connections have been handled.


Next: , Up: microhttpd-info   [Contents][Index]