An IOPipe implementation which listens and spawns connected sockets. More...
#include <lliosocket.h>
Public Member Functions | |
LLIOServerSocket (apr_pool_t *pool, socket_t listener, factory_t reactor) | |
void | setResponseTimeout (F32 timeout_secs) |
Set the timeout for the generated chains. | |
Protected Member Functions | |
virtual EStatus | process_impl (const LLChannelDescriptors &channels, buffer_ptr_t &buffer, bool &eos, LLSD &context, LLPumpIO *pump) |
Process the data in buffer. |
An IOPipe implementation which listens and spawns connected sockets.
Each server socket instance coordinates with a pump to ensure it only processes waiting connections. It uses the provided socket, and assumes it is correctly initialized. When the connection is established, the server will call the chain factory to build a chain, and attach a socket reader and the front and a socket writer at the end. It is up to the chain factory to create something which correctly handles the established connection using the reader as a source, and the writer as the final sink. The newly added chain timeout is in DEFAULT_CHAIN_EXPIRY_SECS unless adjusted with a call to setResponseTimeout().
LLIOServerSocket::LLIOServerSocket | ( | apr_pool_t * | pool, | |
LLIOServerSocket::socket_t | listener, | |||
factory_t | factory | |||
) |
void LLIOServerSocket::setResponseTimeout | ( | F32 | timeout_secs | ) |
Set the timeout for the generated chains.
This value is passed directly to the LLPumpIO::addChain() method. The default on construction is set to DEFAULT_CHAIN_EXPIRY_SECS which is a reasonable value for most applications based on this library. Avoid passing in NEVER_CHAIN_EXPIRY_SECS unless you have another method of harvesting chains.
timeout_secs | The seconds before timeout for the response chain. |