29 #ifndef FASTCGIPP_TRANSCEIVER_HPP 30 #define FASTCGIPP_TRANSCEIVER_HPP 150 uint32_t permissions = 0xffffffffUL,
151 const char* owner =
nullptr,
152 const char* group =
nullptr)
170 const char* interface,
193 data(
std::move(data_)),
232 #if FASTCGIPP_LOG_LEVEL > 3 233 std::atomic_ullong m_connectionKillCount;
237 std::atomic_ullong m_connectionRDHupCount;
240 std::atomic_ullong m_recordsSent;
243 std::atomic_ullong m_recordsQueued;
246 std::atomic_ullong m_recordsReceived;
Topmost namespace for the fastcgi++ library.
void send(const Socket &socket, Block &&data, bool kill)
Queue up a block of data for transmission.
bool listen(const char *interface, const char *service)
Listen to a TCP port.
std::deque< std::unique_ptr< Record > > m_sendBuffer
Buffer for transmitting data
void handler()
General transceiver handler.
void join()
Block until a stop() or terminate() is called and completed.
void cleanupSocket(const Socket &socket)
Cleanup a dead socket.
Data structure used to pass messages to requests.
SocketGroup m_sockets
Listen for connections with this.
Transceiver(const std::function< void(Protocol::RequestId, Message &&)> sendMessage)
Constructor.
bool listen()
Listen to the default Fastcgi socket.
std::thread m_thread
Thread our handler is running in.
Declares everything for relating to the FastCGI protocol itself.
const std::function< void(Protocol::RequestId, Message &&)> m_sendMessage
Function to call to pass messages to requests.
std::atomic_bool m_terminate
True when handler() should be terminating.
void terminate()
Call from any thread to terminate the handler() thread.
std::mutex mutex
Thread safe the logging mechanism.
Simple FastCGI record to queue up for transmission.
void start()
Call from any thread to start the handler() thread.
std::map< Socket, Block > m_receiveBuffers
Container associating sockets with their receive buffers.
Class for representing an OS level I/O socket.
void receive(Socket &socket)
Receive data on the specified socket.
A unique identifier for each FastCGI request.
Handles low level communication with "the other side".
Record(const Socket &socket_, Block &&data_, bool kill_)
bool listen()
Listen to the default Fastcgi socket.
void stop()
Call from any thread to stop the handler() thread.
std::atomic_bool m_stop
True when handler() should be stopping.
Class for representing an OS level socket that listens for connections.
bool transmit()
Transmit all buffered data possible.
Declares the Block data structure.
bool listen(const char *name, uint32_t permissions=0xffffffffUL, const char *owner=nullptr, const char *group=nullptr)
Listen to a named socket.
std::mutex m_sendBufferMutex
Thread safe the send buffer.
Data structure to hold a block of raw data.