[Apache]

Package Name: Apache Listeners Library

struct ap_listen_rec


struct ap_listen_rec

Source:./include/ap_listen.h

@file ap_config.h @brief Symbol export macros and hook functions @defgroup hooks Apache Hooks AP_DECLARE_STATIC is defined when including Apache's Core headers, to provide static linkage when the dynamic library may be unavailable. AP_DECLARE_STATIC and AP_DECLARE_EXPORT are left undefined when including Apache's Core headers, to import and link the symbols from the dynamic Apache Core library and assure appropriate indirection and calling conventions at compile time. AP_DECLARE_EXPORT is defined when building the Apache Core dynamic library, so that all public symbols are exported. Apache Core dso functions are declared with AP_DECLARE(), so they may use the most appropriate calling convention. Hook functions and other Core functions with variable arguments must use AP_DECLARE_NONSTD(). @code AP_DECLARE(rettype) ap_func(args) @endcode Apache Core dso variable argument and hook functions are declared with AP_DECLARE_NONSTD(), as they must use the C language calling convention. @code AP_DECLARE_NONSTD(rettype) ap_func(args [...]) @endcode Apache Core dso variables are declared with AP_MODULE_DECLARE_DATA. This assures the appropriate indirection is invoked at compile time. @note AP_DECLARE_DATA extern type apr_variable; syntax is required for declarations within headers to properly import the variable. @code AP_DECLARE_DATA type apr_variable @endcode Declare a dso module's exported module structure as AP_MODULE_DECLARE_DATA. Unless AP_MODULE_DECLARE_STATIC is defined at compile time, symbols declared with AP_MODULE_DECLARE_DATA are always exported. @code module AP_MODULE_DECLARE_DATA mod_tag @endcode AP_MODULE_DECLARE_EXPORT is a no-op. Unless contradicted by the AP_MODULE_DECLARE_STATIC compile-time symbol, it is assumed and defined. The old SHARED_MODULE compile-time symbol is now the default behavior, so it is no longer referenced anywhere with Apache 2.0. Declare a hook function @internal Implement an Apache core hook that has no return code, and therefore runs all of the registered functions. The implementation is called ap_run_name. @note If IMPLEMENTing a hook that is not linked into the Apache core, (e.g. within a dso) see APR_IMPLEMENT_EXTERNAL_HOOK_VOID. Implement an Apache core hook that runs until one of the functions returns something other than ok or decline. That return value is then returned from the hook runner. If the hooks run to completion, then ok is returned. Note that if no hook runs it would probably be more correct to return decline, but this currently does not do so. The implementation is called ap_run_name. @note If IMPLEMENTing a hook that is not linked into the Apache core, (e.g. within a dso) see APR_IMPLEMENT_EXTERNAL_HOOK_RUN_ALL. Implement a hook that runs until a function returns something other than decline. If all functions return decline, the hook runner returns decline. The implementation is called ap_run_name. @note If IMPLEMENTing a hook that is not linked into the Apache core (e.g. within a dso) see APR_IMPLEMENT_EXTERNAL_HOOK_RUN_FIRST. Implement an optional hook. This is exactly the same as a standard hook implementation, except the hook is optional. Hook an optional hook. Unlike static hooks, this uses a macro instead of a function. Apache's listeners record. These are used in the Multi-Processing Modules to setup all of the sockets for the MPM to listen to and accept on.

See Also
AP_DECLARE_EXPORT,AP_DECLARE_STATIC,AP_DECLARE,AP_IMPLEMENT_HOOK_RUN_ALL

Member Index

Class Variables

accept_function accept_func;
The accept function for this socket

int active;
Is this socket currently active

apr_sockaddr_t *bind_addr;
The sockaddr the socket should bind to

ap_listen_rec *next;
The next listener in the list

apr_socket_t *sd;
The actual socket

Global Variables

AP_DECLARE_DATA extern ap_listen_rec *ap_listeners;
The global list of ap_listen_rec structures

Global Functions

int ap_listen_open(process_rec *process, apr_port_t port);
Create and open a socket on the specified port. This includes listening and binding the socket.

This function is only available to Windows platforms, or the Prefork or SPMT_OS2 MPMs.

Parameters
processThe process record for the currently running server
portThe port to open a socket on.
Return Value
The number of open sockets

void ap_listen_pre_config(void);
Setup all of the defaults for the listener list

int ap_setup_listeners(server_rec *s);
Loop through the global ap_listen_rec list and create all of the required sockets. This executes the listen and bind on the sockets.

This function is not available to Windows platforms, or the Prefork or SPMT_OS2 MPMs.

Parameters
sThe global server_rec
Return Value
The number of open sockets.


© 2000 [Apache Software Foundation]
Generated by ScanDoc 0.14
Last Updated: Fri Apr 14 12:43:20 2006