⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 apr_network_io.h

📁 Apache V2.0.15 Alpha For Linuxhttpd-2_0_15-alpha.tar.Z
💻 H
📖 第 1 页 / 共 3 页
字号:
 * @deffunc apr_status_t apr_socket_close(apr_socket_t *thesocket) */APR_DECLARE(apr_status_t) apr_socket_close(apr_socket_t *thesocket);/** * Bind the socket to its associated port * @param sock The socket to bind  * @param sa The socket address to bind to * @tip This may be where we will find out if there is any other process *      using the selected port. * @deffunc apr_status_t apr_bind(apr_socket_t *sock, apr_sockaddr_t *sa) */APR_DECLARE(apr_status_t) apr_bind(apr_socket_t *sock, apr_sockaddr_t *sa);/** * Listen to a bound socket for connections. * @param sock The socket to listen on  * @param backlog The number of outstanding connections allowed in the sockets *                listen queue.  If this value is less than zero, the listen *                queue size is set to zero.   * @deffunc apr_status_t apr_listen(apr_socket_t *sock, apr_int32_t backlog) */APR_DECLARE(apr_status_t) apr_listen(apr_socket_t *sock, apr_int32_t backlog);/** * Accept a new connection request * @param new_sock A copy of the socket that is connected to the socket that *                 made the connection request.  This is the socket which should *                 be used for all future communication. * @param sock The socket we are listening on. * @param connection_pool The pool for the new socket. * @deffunc apr_status_t apr_accept(apr_socket_t **new_sock, apr_socket_t *sock, apr_pool_t *connection_pool) */APR_DECLARE(apr_status_t) apr_accept(apr_socket_t **new_sock,                                      apr_socket_t *sock,                                     apr_pool_t *connection_pool);/** * Issue a connection request to a socket either on the same machine  * or a different one. * @param sock The socket we wish to use for our side of the connection  * @param sa The address of the machine we wish to connect to.  If NULL, *           APR assumes that the sockaddr_in in the apr_socket is  *           completely filled out. * @deffunc apr_status_t apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa) */APR_DECLARE(apr_status_t) apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa);/** * Create apr_sockaddr_t from hostname, address family, and port. * @param sa The new apr_sockaddr_t. * @param hostname The hostname or numeric address string to resolve/parse. * @param family The address family to use, or APR_UNSPEC if the system should  *               decide. * @param port The port number. * @param flags Special processing flags. * @param p The pool for the apr_sockaddr_t and associated storage. * @deffunc apr_status_t apr_sockaddr_info_get(apr_sockaddr_t **sa, const char *hostname, apr_int32_t family, apr_port_t port, apr_int32_t flags, apr_pool_t *p) */APR_DECLARE(apr_status_t) apr_sockaddr_info_get(apr_sockaddr_t **sa,                                          const char *hostname,                                          apr_int32_t family,                                          apr_port_t port,                                          apr_int32_t flags,                                          apr_pool_t *p);/** * Look up the host name from an apr_sockaddr_t. * @param hostname The hostname. * @param sa The apr_sockaddr_t. * @param flags Special processing flags. * @deffunc apr_status_t apr_getnameinfo(char **hostname, apr_sockaddr_t *sa, apr_int32_t flags) */APR_DECLARE(apr_status_t) apr_getnameinfo(char **hostname,                                          apr_sockaddr_t *sa,                                          apr_int32_t flags);                             /** * Parse hostname/IP address with scope id and port. * * Any of the following strings are accepted: *   8080                  (just the port number) *   www.apache.org        (just the hostname) *   www.apache.org:8080   (hostname and port number) *   [fe80::1]:80          (IPv6 numeric address string only) *   [fe80::1%eth0]        (IPv6 numeric address string and scope id) * * Invalid strings: *                         (empty string) *   [abc]                 (not valid IPv6 numeric address string) *   abc:65536             (invalid port number) * * @param addr The new buffer containing just the hostname.  On output, *addr  *             will be NULL if no hostname/IP address was specfied. * @param scope_id The new buffer containing just the scope id.  On output,  *                 *scope_id will be NULL if no scope id was specified. * @param port The port number.  On output, *port will be 0 if no port was  *             specified. * @param str The input string to be parsed. * @param p The pool from which *addr and *scope_id are allocated. * @tip If scope id shouldn't be allowed, check for scope_id != NULL in addition  *      to checking the return code.  If addr/hostname should be required, check  *      for addr == NULL in addition to checking the return code. * @deffunc apr_status_t apr_parse_addr_port(char **addr, char **scope_id, apr_port_t *port, const char *str, apr_pool_t *p) */APR_DECLARE(apr_status_t) apr_parse_addr_port(char **addr,                                              char **scope_id,                                              apr_port_t *port,                                              const char *str,                                              apr_pool_t *p);/** * Get name of the current machine * @param buf A buffer to store the hostname in. * @param len The maximum length of the hostname that can be stored in the *            buffer provided.  * @param cont The pool to use. * @deffunc apr_status_t apr_gethostname(char *buf, int len, apr_pool_t *cont) */APR_DECLARE(apr_status_t) apr_gethostname(char *buf, int len, apr_pool_t *cont);/** * Return the data associated with the current socket * @param data The user data associated with the socket. * @param key The key to associate with the user data. * @param sock The currently open socket. * @deffunc apr_status_t apr_socket_data_get(void **data, const char *key, apr_socket_t *sock) */APR_DECLARE(apr_status_t) apr_socket_data_get(void **data, const char *key,                                             apr_socket_t *sock);/** * Set the data associated with the current socket. * @param sock The currently open socket. * @param data The user data to associate with the socket. * @param key The key to associate with the data. * @param cleanup The cleanup to call when the socket is destroyed. * @deffunc apr_status_t apr_socket_data_set(apr_socket_t *sock, void *data, const char *key, apr_status_t (*cleanup)(void*)) */APR_DECLARE(apr_status_t) apr_socket_data_set(apr_socket_t *sock, void *data,                                             const char *key,                                             apr_status_t (*cleanup)(void*));/** * Send data over a network. * @param sock The socket to send the data over. * @param buf The buffer which contains the data to be sent.  * @param len On entry, the number of bytes to send; on exit, the number *            of bytes sent. * @deffunc apr_status_t apr_send(apr_socket_t *sock, const char *buf, apr_size_t *len) * @tip * <PRE> * This functions acts like a blocking write by default.  To change  * this behavior, use apr_setsocketopt with the APR_SO_TIMEOUT option. * * It is possible for both bytes to be sent and an error to be returned. * * APR_EINTR is never returned. * </PRE> */APR_DECLARE(apr_status_t) apr_send(apr_socket_t *sock, const char *buf,                                    apr_size_t *len);/** * Send multiple packets of data over a network. * @param sock The socket to send the data over. * @param vec The array of iovec structs containing the data to send  * @param nvec The number of iovec structs in the array * @param len Receives the number of bytes actually written * @deffunc apr_status_t apr_sendv(apr_socket_t *sock, const struct iovec *vec, apr_int32_t nvec, apr_size_t *len) * @tip * <PRE> * This functions acts like a blocking write by default.  To change  * this behavior, use apr_setsocketopt with the APR_SO_TIMEOUT option. * The number of bytes actually sent is stored in argument 3. * * It is possible for both bytes to be sent and an error to be returned. * * APR_EINTR is never returned. * </PRE> */APR_DECLARE(apr_status_t) apr_sendv(apr_socket_t *sock,                                     const struct iovec *vec,                                    apr_int32_t nvec, apr_size_t *len);/** * @param sock The socket to send from * @param where The apr_sockaddr_t describing where to send the data * @param data The data to send * @param len  The length of the data to send */APR_DECLARE(apr_status_t) apr_sendto(apr_socket_t *sock, apr_sockaddr_t *where,                                     apr_int32_t flags, const char *buf,                                      apr_size_t *len);/** * @param from The apr_sockaddr_t to fill in the recipient info * @param sock The socket to use * @param buf  The buffer to use * @param len  The length of the available buffer */APR_DECLARE(apr_status_t) apr_recvfrom(apr_sockaddr_t *from, apr_socket_t *sock,                                       apr_int32_t flags, char *buf,                                        apr_size_t *len); #if APR_HAS_SENDFILE/** * Send a file from an open file descriptor to a socket, along with  * optional headers and trailers * @param sock The socket to which we're writing * @param file The open file from which to read * @param hdtr A structure containing the headers and trailers to send * @param offset Offset into the file where we should begin writing * @param len (input)  - Number of bytes to send from the file  *            (output) - Number of bytes actually sent,  *                       including headers, file, and trailers * @param flags APR flags that are mapped to OS specific flags * @deffunc apr_status_t apr_sendfile(apr_socket_t *sock, apr_file_t *file, apr_hdtr_t *hdtr, apr_off_t *offset, apr_size_t *len, apr_int32_t flags) * @tip This functions acts like a blocking write by default.  To change  *      this behavior, use apr_setsocketopt with the APR_SO_TIMEOUT option. *      The number of bytes actually sent is stored in argument 5. */APR_DECLARE(apr_status_t) apr_sendfile(apr_socket_t *sock, apr_file_t *file,                                       apr_hdtr_t *hdtr, apr_off_t *offset,                                       apr_size_t *len, apr_int32_t flags);#endif /* APR_HAS_SENDFILE *//** * Read data from a network. * @param sock The socket to read the data from. * @param buf The buffer to store the data in.  * @param len On entry, the number of bytes to receive; on exit, the number *            of bytes received. * @deffunc apr_status_t apr_recv(apr_socket_t *sock, char *buf, apr_size_t *len) * @tip * <PRE> * This functions acts like a blocking read by default.  To change  * this behavior, use apr_setsocketopt with the APR_SO_TIMEOUT option. * The number of bytes actually sent is stored in argument 3. * * It is possible for both bytes to be received and an APR_EOF or * other error to be returned. * * APR_EINTR is never returned. * </PRE> */APR_DECLARE(apr_status_t) apr_recv(apr_socket_t *sock,                                    char *buf, apr_size_t *len);/** * Setup socket options for the specified socket * @param sock The socket to set up. * @param opt The option we would like to configure.  One of: * <PRE> *            APR_SO_DEBUG      --  turn on debugging information  *            APR_SO_KEEPALIVE  --  keep connections active *            APR_SO_LINGER     --  lingers on close if data is present *            APR_SO_NONBLOCK   --  Turns blocking on/off for socket *            APR_SO_REUSEADDR  --  The rules used in validating addresses *                                  supplied to bind should allow reuse *                                  of local addresses. *            APR_SO_TIMEOUT    --  Set the timeout value in microseconds. *                                  values < 0 mean wait forever.  0 means

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -