select.inc (2473B)
1 2 @deftypefun enum MHD_Result MHD_get_fdset (struct MHD_Daemon *daemon, fd_set * read_fd_set, fd_set * write_fd_set, fd_set * except_fd_set, int *max_fd) 3 Obtain the @code{select()} sets for this daemon. The daemon's socket 4 is added to @var{read_fd_set}. The list of currently existent 5 connections is scanned and their file descriptors added to the correct 6 set. 7 8 When calling this function, FD_SETSIZE is assumed to be platform's 9 default. If you changed FD_SETSIZE for your application, 10 you should use @code{MHD_get_fdset2()} instead. 11 12 This function should only be called in when MHD is configured to use 13 external select with @code{select()} or with @code{epoll()}. In 14 the latter case, it will only add the single @code{epoll()} file 15 descriptor used by MHD to the sets. 16 17 After the call completed successfully: the variable referenced by 18 @var{max_fd} references the file descriptor with highest integer 19 identifier. The variable must be set to zero before invoking this 20 function. 21 22 Return @code{MHD_YES} on success, @code{MHD_NO} if: the arguments are 23 invalid (example: @code{NULL} pointers); this daemon was not started with 24 the right options for this call. 25 @end deftypefun 26 27 28 @deftypefun enum MHD_Result MHD_get_fdset2 (struct MHD_Daemon *daemon, fd_set * read_fd_set, fd_set * write_fd_set, fd_set * except_fd_set, int *max_fd, unsigned int fd_setsize) 29 Like @code{MHD_get_fdset()}, except that you can manually specify the value of FD_SETSIZE used by your application. 30 @end deftypefun 31 32 33 @deftypefun enum MHD_Result MHD_get_timeout (struct MHD_Daemon *daemon, unsigned long long *timeout) 34 @cindex timeout 35 Obtain timeout value for select for this daemon (only needed if 36 connection timeout is used). The returned value is how many 37 milliseconds @code{select} should at most block, not the timeout value 38 set for connections. This function must not be called if the 39 @code{MHD_USE_THREAD_PER_CONNECTION} mode is in use (since then it is 40 not meaningful to ask for a timeout, after all, there is concurrenct 41 activity). The function must also not be called by user-code if 42 @code{MHD_USE_INTERNAL_POLLING_THREAD} is in use. In the latter case, the 43 behavior is undefined. 44 45 @table @var 46 @item daemon 47 which daemon to obtain the timeout from. 48 @item timeout 49 will be set to the timeout (in milliseconds). 50 @end table 51 52 Return @code{MHD_YES} on success, @code{MHD_NO} if timeouts are not used 53 (or no connections exist that would necessitate the use of a timeout 54 right now). 55 @end deftypefun 56