39#ifndef __HttpConnection_h
40#define __HttpConnection_h
57 HttpConnection_Free=0,
58 HttpConnection_Connected,
60 HttpConnection_Running,
62 HttpConnection_Terminated,
65 HttpConnection_HardClose
66} HttpConnection_State;
77 void *
operator new(size_t,
void *place) {
return place; }
78 void operator delete(
void*,
void *) { }
103 int pushBackDataSize;
108#define HttpConnection_setKeepAlive(o) (o)->keepAlive=TRUE
109#define HttpConnection_clearKeepAlive(o) (o)->keepAlive=FALSE
110#define HttpConnection_keepAlive(o) (o)->keepAlive
111#define HttpConnection_getState(o) (o)->state
112#define HttpConnection_getServer(o) (o)->server
113#define HttpConnection_getDispatcher(o) SoDispCon_getDispatcher((SoDispCon*)o)
114#define HttpConnection_dispRecEvent(o) SoDispCon_dispRecEvent((SoDispCon*)o)
115#define HttpConnection_newConnectionIsReady(con) \
116 SoDispCon_newConnectionIsReady(con)
123 struct SoDisp* dispatcher,
124 SoDispCon_DispRecEv e);
125BA_API
void HttpConnection_setState(
128int HttpConnection_sendChunkData6bOffs(
131BA_API
int HttpConnection_pushBack(
HttpConnection* o,
const void* d,
int s);
132#define HttpConnection_isSecure(o)\
133 SoDispCon_isSecure((SoDispCon*)o)
134#define HttpConnection_isValid(o)\
135 SoDispCon_isValid((SoDispCon*)o)
136#define HttpConnection_sendData(o, data, len)\
137 SoDispCon_sendData((SoDispCon*)o, data, len)
138#define HttpConnection_sendDataNT(o, data, len)\
139 SoDispCon_sendDataNT((SoDispCon*)o, data, len)
140#define HttpConnection_sendChunkData(o,data, len)\
141 SoDispCon_sendChunkData((SoDispCon*)o,data, len)
142#define HttpConnection_allocAsynchBuf(o, sizePtr)\
143 SoDispCon_allocAsynchBuf((SoDispCon*)o, sizePtr)
144#define HttpConnection_asyncSend(o,len) SoDispCon_asyncSend((SoDispCon*)o,len)
145#define HttpConnection_asyncReady(o) SoDispCon_asyncReady((SoDispCon*)o)
146BA_API
int HttpConnection_readData(
HttpConnection* con,
void* data,
int len);
147BA_API
int HttpConnection_blockRead(
HttpConnection* con,
void* data,
int len);
148#define HttpConnection_setNonblocking(o)\
149 SoDispCon_setNonblocking((SoDispCon*)o)
150#define HttpConnection_setBlocking(o)\
151 SoDispCon_setBlocking((SoDispCon*)o)
152#define HttpConnection_peek(o)\
153 SoDispCon_peek((SoDispCon*)o)
154#define HttpConnection_setTCPNoDelay(o, enable)\
155 SoDispCon_setTCPNoDelay((SoDispCon*)o, enable)
156#define HttpConnection_getPeerName(o, addr,port)\
157 SoDispCon_getPeerName((SoDispCon*)o, addr,port)
158#define HttpConnection_getSockName(o, addr,port)\
159 SoDispCon_getSockName((SoDispCon*)o, addr,port)
160#define HttpConnection_addr2String(o, addr, buf, len)\
161 SoDispCon_addr2String((SoDispCon*)o, addr, buf, len)
162#define HttpConnection_cmpAddr(o, addr2)\
163 SoDispCon_cmpAddr((SoDispCon*)o, addr2)
164#define HttpConnection_recEvActive(o)\
165 SoDispCon_recEvActive((SoDispCon*)o)
166#define HttpConnection_sendEvActive(o)\
167 SoDispCon_sendEvActive((SoDispCon*)o)
168#define HttpConnection_hasMoreData(o)\
169 (SoDispCon_hasMoreData((SoDispCon*)o) || (o)->pushBackData)
170#define HttpConnection_dispatcherHasCon(o)\
171 SoDispCon_dispatcherHasCon((SoDispCon*)o)
172#define HttpConnection_setDispSendEvent(o, dispSendEvFp)\
173 SoDispCon_setDispSendEvent((SoDispCon*)o, dispSendEvFp)
177 HttpConnection_setKeepAlive(
this);
180 HttpConnection_clearKeepAlive(
this);
struct HttpServer * getServer()
Fetch the HttpServer object.
Definition: HttpServer.h:3164
The HttpCommand class is a container class for the HttpRequest and HttpResponse command pair.
Definition: HttpServer.h:1818
Contains information about the physical socket connection.
Definition: HttpConnection.h:76
void clearKeepAlive()
Keep connection after request completed, i.e.
Definition: HttpConnection.h:179
void setKeepAlive()
Close connection after request completed.
Definition: HttpConnection.h:176
The Web Server.
Definition: HttpServer.h:2864
Contains information about the physical socket connection.
Definition: SoDispCon.h:112
The SoDisp dispatches any socket connection that contains data by calling the SoDispCon::execute memb...
Definition: SoDisp.h:86