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

📄 apr_network_io.h

📁 Apache官方在今天放出产品系列2.2的最新版本2.2.11的源码包 最流行的HTTP服务器软件之一
💻 H
📖 第 1 页 / 共 3 页
字号:
 * <PRE> * This functions acts like a blocking read by default.  To change  * this behavior, use apr_socket_timeout_set() or the APR_SO_NONBLOCK * socket option. * The number of bytes actually received 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_socket_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 *                                  When this option is enabled, use *                                  the APR_STATUS_IS_EAGAIN() macro to *                                  see if a send or receive function *                                  could not transfer data without *                                  blocking. *            APR_SO_REUSEADDR  --  The rules used in validating addresses *                                  supplied to bind should allow reuse *                                  of local addresses. *            APR_SO_SNDBUF     --  Set the SendBufferSize *            APR_SO_RCVBUF     --  Set the ReceiveBufferSize * </PRE> * @param on Value for the option. */APR_DECLARE(apr_status_t) apr_socket_opt_set(apr_socket_t *sock,                                             apr_int32_t opt, apr_int32_t on);/** * Setup socket timeout for the specified socket * @param sock The socket to set up. * @param t Value for the timeout. * <PRE> *   t > 0  -- read and write calls return APR_TIMEUP if specified time *             elapsess with no data read or written *   t == 0 -- read and write calls never block *   t < 0  -- read and write calls block * </PRE> */APR_DECLARE(apr_status_t) apr_socket_timeout_set(apr_socket_t *sock,                                                 apr_interval_time_t t);/** * Query socket options for the specified socket * @param sock The socket to query * @param opt The option we would like to query.  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_SNDBUF     --  Set the SendBufferSize *            APR_SO_RCVBUF     --  Set the ReceiveBufferSize *            APR_SO_DISCONNECTED -- Query the disconnected state of the socket. *                                  (Currently only used on Windows) * </PRE> * @param on Socket option returned on the call. */APR_DECLARE(apr_status_t) apr_socket_opt_get(apr_socket_t *sock,                                              apr_int32_t opt, apr_int32_t *on);/** * Query socket timeout for the specified socket * @param sock The socket to query * @param t Socket timeout returned from the query. */APR_DECLARE(apr_status_t) apr_socket_timeout_get(apr_socket_t *sock,                                                  apr_interval_time_t *t);/** * Query the specified socket if at the OOB/Urgent data mark * @param sock The socket to query * @param atmark Is set to true if socket is at the OOB/urgent mark, *               otherwise is set to false. */APR_DECLARE(apr_status_t) apr_socket_atmark(apr_socket_t *sock,                                             int *atmark);/** * Return an address associated with a socket; either the address to * which the socket is bound locally or the the address of the peer * to which the socket is connected. * @param sa The returned apr_sockaddr_t. * @param which Whether to retrieve the local or remote address * @param sock The socket to use */APR_DECLARE(apr_status_t) apr_socket_addr_get(apr_sockaddr_t **sa,                                              apr_interface_e which,                                              apr_socket_t *sock); /** * Return the IP address (in numeric address string format) in * an APR socket address.  APR will allocate storage for the IP address  * string from the pool of the apr_sockaddr_t. * @param addr The IP address. * @param sockaddr The socket address to reference. */APR_DECLARE(apr_status_t) apr_sockaddr_ip_get(char **addr,                                               apr_sockaddr_t *sockaddr);/** * Write the IP address (in numeric address string format) of the APR * socket address @a sockaddr into the buffer @a buf (of size @a buflen). * @param sockaddr The socket address to reference. */APR_DECLARE(apr_status_t) apr_sockaddr_ip_getbuf(char *buf, apr_size_t buflen,                                                 apr_sockaddr_t *sockaddr);/** * See if the IP addresses in two APR socket addresses are * equivalent.  Appropriate logic is present for comparing * IPv4-mapped IPv6 addresses with IPv4 addresses. * * @param addr1 One of the APR socket addresses. * @param addr2 The other APR socket address. * @remark The return value will be non-zero if the addresses * are equivalent. */APR_DECLARE(int) apr_sockaddr_equal(const apr_sockaddr_t *addr1,                                    const apr_sockaddr_t *addr2);/*** Return the type of the socket.* @param sock The socket to query.* @param type The returned type (e.g., SOCK_STREAM).*/APR_DECLARE(apr_status_t) apr_socket_type_get(apr_socket_t *sock,                                              int *type); /** * Given an apr_sockaddr_t and a service name, set the port for the service * @param sockaddr The apr_sockaddr_t that will have its port set * @param servname The name of the service you wish to use */APR_DECLARE(apr_status_t) apr_getservbyname(apr_sockaddr_t *sockaddr,                                             const char *servname);/** * Build an ip-subnet representation from an IP address and optional netmask or * number-of-bits. * @param ipsub The new ip-subnet representation * @param ipstr The input IP address string * @param mask_or_numbits The input netmask or number-of-bits string, or NULL * @param p The pool to allocate from */APR_DECLARE(apr_status_t) apr_ipsubnet_create(apr_ipsubnet_t **ipsub,                                               const char *ipstr,                                               const char *mask_or_numbits,                                               apr_pool_t *p);/** * Test the IP address in an apr_sockaddr_t against a pre-built ip-subnet * representation. * @param ipsub The ip-subnet representation * @param sa The socket address to test * @return non-zero if the socket address is within the subnet, 0 otherwise */APR_DECLARE(int) apr_ipsubnet_test(apr_ipsubnet_t *ipsub, apr_sockaddr_t *sa);#if APR_HAS_SO_ACCEPTFILTER || defined(DOXYGEN)/** * Set an OS level accept filter. * @param sock The socket to put the accept filter on. * @param name The accept filter * @param args Any extra args to the accept filter.  Passing NULL here removes *             the accept filter.  */apr_status_t apr_socket_accept_filter(apr_socket_t *sock, char *name,                                      char *args);#endif/** * Return the protocol of the socket. * @param sock The socket to query. * @param protocol The returned protocol (e.g., APR_PROTO_TCP). */APR_DECLARE(apr_status_t) apr_socket_protocol_get(apr_socket_t *sock,                                                  int *protocol);/** * Get the pool used by the socket. */APR_POOL_DECLARE_ACCESSOR(socket);/** * Set a socket to be inherited by child processes. */APR_DECLARE_INHERIT_SET(socket);/** * Unset a socket from being inherited by child processes. */APR_DECLARE_INHERIT_UNSET(socket);/** * @defgroup apr_mcast IP Multicast * @{ *//** * Join a Multicast Group * @param sock The socket to join a multicast group * @param join The address of the multicast group to join * @param iface Address of the interface to use.  If NULL is passed, the  *              default multicast interface will be used. (OS Dependent) * @param source Source Address to accept transmissions from (non-NULL  *               implies Source-Specific Multicast) */APR_DECLARE(apr_status_t) apr_mcast_join(apr_socket_t *sock,                                         apr_sockaddr_t *join,                                         apr_sockaddr_t *iface,                                         apr_sockaddr_t *source);/** * Leave a Multicast Group.  All arguments must be the same as * apr_mcast_join. * @param sock The socket to leave a multicast group * @param addr The address of the multicast group to leave * @param iface Address of the interface to use.  If NULL is passed, the  *              default multicast interface will be used. (OS Dependent) * @param source Source Address to accept transmissions from (non-NULL  *               implies Source-Specific Multicast) */APR_DECLARE(apr_status_t) apr_mcast_leave(apr_socket_t *sock,                                          apr_sockaddr_t *addr,                                          apr_sockaddr_t *iface,                                          apr_sockaddr_t *source);/** * Set the Multicast Time to Live (ttl) for a multicast transmission. * @param sock The socket to set the multicast ttl * @param ttl Time to live to Assign. 0-255, default=1 * @remark If the TTL is 0, packets will only be seen by sockets on  * the local machine, and only when multicast loopback is enabled. */APR_DECLARE(apr_status_t) apr_mcast_hops(apr_socket_t *sock,                                         apr_byte_t ttl);/** * Toggle IP Multicast Loopback * @param sock The socket to set multicast loopback * @param opt 0=disable, 1=enable */APR_DECLARE(apr_status_t) apr_mcast_loopback(apr_socket_t *sock,                                             apr_byte_t opt);/** * Set the Interface to be used for outgoing Multicast Transmissions. * @param sock The socket to set the multicast interface on * @param iface Address of the interface to use for Multicast */APR_DECLARE(apr_status_t) apr_mcast_interface(apr_socket_t *sock,                                              apr_sockaddr_t *iface);/** @} *//** @} */#ifdef __cplusplus}#endif#endif  /* ! APR_NETWORK_IO_H */

⌨️ 快捷键说明

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