GNU libmicrohttpd 0.9.77
Loading...
Searching...
No Matches
mhd_sockets.c File Reference
#include "mhd_sockets.h"
#include <fcntl.h>
Include dependency graph for mhd_sockets.c:

Go to the source code of this file.

Functions

int MHD_add_to_fd_set_ (MHD_socket fd, fd_set *set, MHD_socket *max_fd, unsigned int fd_setsize)
 
int MHD_socket_nonblocking_ (MHD_socket sock)
 
int MHD_socket_noninheritable_ (MHD_socket sock)
 
MHD_socket MHD_socket_create_listen_ (int pf)
 

Function Documentation

◆ MHD_add_to_fd_set_()

int MHD_add_to_fd_set_ ( MHD_socket  fd,
fd_set *  set,
MHD_socket max_fd,
unsigned int  fd_setsize 
)

Add fd to the set. If fd is greater than max_fd, set max_fd to fd.

Parameters
fdfile descriptor to add to the set
setset to modify
max_fdmaximum value to potentially update
fd_setsizevalue of FD_SETSIZE
Returns
non-zero if succeeded, zero otherwise

Definition at line 377 of file mhd_sockets.c.

References fd, MHD_INVALID_SOCKET, MHD_SCKT_ADD_FD_TO_FDSET_SETSIZE_, MHD_SCKT_FD_FITS_FDSET_SETSIZE_, and NULL.

Referenced by internal_get_fdset2(), internal_get_fdset2(), MHD_daemon_get_fdset2(), MHD_daemon_select_(), MHD_get_fdset2(), MHD_select(), and thread_main_handle_connection().

Here is the caller graph for this function:

◆ MHD_socket_create_listen_()

MHD_socket MHD_socket_create_listen_ ( int  pf)

Create a listen socket, with noninheritable flag if possible.

Parameters
pfprotocol family to use
Returns
created socket or MHD_INVALID_SOCKET in case of errors

Definition at line 474 of file mhd_sockets.c.

References fd, MHD_INVALID_SOCKET, MHD_socket_close_, MHD_socket_fset_error_, MHD_socket_get_error_, MHD_socket_noninheritable_(), and NULL.

Referenced by MHD_start_daemon_va(), and open_listen_socket().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MHD_socket_nonblocking_()

int MHD_socket_nonblocking_ ( MHD_socket  sock)

Change socket options to be non-blocking.

Parameters
socksocket to manipulate
Returns
non-zero if succeeded, zero otherwise

Definition at line 407 of file mhd_sockets.c.

Referenced by MHD_accept_connection(), MHD_accept_connection_(), MHD_add_connection(), MHD_daemon_add_connection(), MHD_daemon_start(), and MHD_start_daemon_va().

Here is the caller graph for this function:

◆ MHD_socket_noninheritable_()

int MHD_socket_noninheritable_ ( MHD_socket  sock)

Change socket options to be non-inheritable.

Parameters
socksocket to manipulate
Returns
non-zero if succeeded, zero otherwise
Warning
Does not set socket error on W32.

Definition at line 442 of file mhd_sockets.c.

Referenced by MHD_accept_connection(), MHD_accept_connection_(), MHD_add_connection(), MHD_daemon_add_connection(), and MHD_socket_create_listen_().

Here is the caller graph for this function: