EHS Embedded HTTP Server
1.5.1.0
|
26 #ifndef _EHSCONNECTION_H_
27 #define _EHSCONNECTION_H_
62 time_t m_nLastActivity;
68 int m_nActiveRequests;
74 std::string m_sBuffer;
77 ResponseQueue m_oResponseQueue;
80 HttpRequestList m_oHttpRequestList;
83 std::string m_sRemoteAddress;
86 std::string m_sLocalAddress;
94 size_t m_nMaxRequestSize;
97 std::string m_sParseContentType;
99 pthread_mutex_t m_oMutex;
115 DEPRECATED(
"Use GetRemoteAddress()")
122 DEPRECATED(
"Use GetRemotePort()")
133 bool IsRaw()
const {
return m_bRawMode; }
136 void AddResponse(ehs_autoptr<GenericResponse> ehs_rvref response);
165 void UpdateLastActivity() { m_nLastActivity = time(NULL); }
168 time_t LastActivity() {
return m_bIdleHandling ? m_nLastActivity : time(NULL); }
171 bool StillReading() {
return !m_bDoneReading; }
175 void DoneReading (
bool ibDisconnected );
184 enum AddBufferResult {
185 ADDBUFFER_INVALID = 0,
187 ADDBUFFER_INVALIDREQUEST,
193 AddBufferResult AddBuffer(
char * ipsData,
int inSize);
204 int RequestsPending() {
return (0 != m_nActiveRequests) || !m_oHttpRequestList.empty(); }
210 void SetMaxRequestSize(
size_t n) { m_nMaxRequestSize = n; }
213 void SetParseContentType(
const std::string & s) { m_sParseContentType = s; }
218 #endif // _EHSCONNECTION_H_
EHSConnection abstracts the concept of a connection to an EHS application.
void AddResponse(ehs_autoptr< GenericResponse > ehs_rvref response)
adds a response to the response list and sends as many responses as are ready
std::string GetRemoteAddress() const
returns the remote address of the connection.
void EnableKeepAlive(bool enable=true)
Enable/Disable TCP keepalive on the underlying socket.
int GetPort() const
returns client port of the connection.
bool Disconnected() const
returns whether the client has disconnected from us.
bool IsRaw() const
returns whether the this connection is in raw mode.
int GetRemotePort() const
returns the remote port of the connection.
Abstracts different socket types.
void EnableIdleTimeout(bool enable=true)
Enable/Disable idle-timeout handling for this connection.
int GetLocalPort() const
returns the local port of the connection.
This class represents what is sent back to the client.
This class represents a clients HTTP request.
std::string GetLocalAddress() const
returns the local address of the connection.
EHSServer contains all the network related services for EHS.
std::string GetAddress() const
returns address of the connection.