GNU libmicrohttpd
0.9.68
|
Implementation for sockets functions. More...
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) |
int | MHD_socket_set_nodelay_ (MHD_socket sock, bool on) |
int | MHD_socket_cork_ (MHD_socket sock, bool on) |
int | MHD_socket_buffering_reset_ (MHD_socket sock) |
MHD_socket | MHD_socket_create_listen_ (int pf) |
Implementation for sockets functions.
Header for platform-independent sockets abstraction.
Provides basic abstraction for sockets. Any functions can be implemented as macro on some platforms unless explicitly marked otherwise. Any function argument can be skipped in macro, so avoid variable modification in function parameters.
Definition in file mhd_sockets.c.
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.
fd | file descriptor to add to the set |
set | set to modify |
max_fd | maximum value to potentially update |
fd_setsize | value of FD_SETSIZE |
Definition at line 375 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.
int MHD_socket_buffering_reset_ | ( | MHD_socket | sock | ) |
Change socket buffering mode to default.
sock | socket to manipulate |
Definition at line 550 of file mhd_sockets.c.
References MHD_socket_cork_(), and MHD_socket_set_nodelay_().
Referenced by MHD_add_connection().
int MHD_socket_cork_ | ( | MHD_socket | sock, |
bool | on | ||
) |
Enable/disable the cork option.
sock | socket to manipulate |
on | set to true to enable CORK, false to disable |
Definition at line 504 of file mhd_sockets.c.
Referenced by MHD_socket_buffering_reset_(), post_cork_setsockopt(), and pre_cork_setsockopt().
MHD_socket MHD_socket_create_listen_ | ( | int | pf | ) |
Create a listen socket, with noninheritable flag if possible.
pf | protocol family to use |
Definition at line 575 of file mhd_sockets.c.
References fd, MAYBE_MSG_NOSIGNAL, MAYBE_SOCK_CLOEXEC, MAYBE_SOCK_NOSIGPIPE, MHD_INVALID_SOCKET, MHD_socket_close_, MHD_socket_fset_error_, MHD_socket_get_error_, MHD_socket_noninheritable_(), and NULL.
int MHD_socket_nonblocking_ | ( | MHD_socket | sock | ) |
Change socket options to be non-blocking.
sock | socket to manipulate |
Definition at line 405 of file mhd_sockets.c.
int MHD_socket_noninheritable_ | ( | MHD_socket | sock | ) |
Change socket options to be non-inheritable.
sock | socket to manipulate |
Definition at line 440 of file mhd_sockets.c.
int MHD_socket_set_nodelay_ | ( | MHD_socket | sock, |
bool | on | ||
) |
Disable Nagle's algorithm on sock. This is what we do by default for all TCP sockets in MHD, unless the platform does not support the MSG_MORE or MSG_CORK or MSG_NOPUSH options.
sock | socket to manipulate |
on | value to use |
Definition at line 475 of file mhd_sockets.c.
Referenced by MHD_accept_connection(), MHD_socket_buffering_reset_(), post_cork_setsockopt(), and pre_cork_setsockopt().