Barracuda Application Server C/C++ Reference
Native APIs, integration guides, and platform interfaces
HttpConnection Struct Reference

Detailed Description

Contains information about the physical socket connection.

This object is used internally by HttpServer when sending and receiving data on either an insecure or secure SSL connection.

#include <HttpConnection.h>

Inheritance diagram for HttpConnection:

Public Member Functions

 HttpConnection ()
 Uninitialized storage; use HttpConnection_constructor before use. More...
 
struct HttpServer * getServer ()
 
void setKeepAlive ()
 Enable persistent connection reuse after a completed HTTP request. More...
 
void clearKeepAlive ()
 Disable persistent connection reuse after the request completes. More...
 
- Public Member Functions inherited from SoDispCon
 SoDispCon ()
 Uninitialized storage; call SoDispCon_constructor before use. More...
 
int connect (const char *host, U16 port, const void *bindIntfName=0, U16 bindPort=0, U32 timeout=1500, BaBool dgram=false, BaBool ipv6=false, char **errinfo=0)
 Connect an initialized, empty connection to a remote endpoint. More...
 
bool isSecure ()
 Deprecated: Use getSharkSslCon(NULL). More...
 
bool getSharkSslCon (SharkSslCon **sc)
 Inspect a connected transport's TLS implementation. More...
 
bool isValid ()
 
bool isIP6 ()
 
int getPeerName (HttpSockaddr *addr, U16 *port=0)
 Read the remote peer endpoint. More...
 
int getSockName (HttpSockaddr *addr, U16 *port=0)
 Read the local socket endpoint. More...
 
char * addr2String (HttpSockaddr *addr, char *buf, int len)
 Format a numeric address without a port number. More...
 
bool cmpAddr (HttpSockaddr *addr2)
 Compare an address with the current peer address, ignoring port numbers. More...
 
void setTCPNoDelay (bool enable)
 Disable the TCP delay. More...
 
struct SoDisp * getDispatcher ()
 
bool hasMoreData ()
 
bool dispatcherHasCon ()
 
bool recEvActive ()
 
bool sendEvActive ()
 
void setDispSendEvent (SoDispCon_DispSendEv ev)
 Install a send-ready callback before enabling send events. More...
 
void setDispRecEvent (SoDispCon_DispRecEv ev)
 Install a receive callback before enabling receive events. More...
 
int readData (void *data, int len, bool relmutex=false)
 Read through the installed transport using its recorded readiness. More...
 
int setNonblocking ()
 Select nonblocking socket mode. More...
 
int setBlocking ()
 Select blocking socket mode. More...
 
int sendData (const void *data, int len)
 Send an entire buffer through the installed transport. More...
 
int asyncSend (int len)
 Begin or advance a send from the transport's asynchronous buffer. More...
 
int sendChunkData (const void *data, int len)
 Send one HTTP chunk, including its hexadecimal size and CRLF delimiters. More...
 
int asyncReady ()
 Advance pending output and inspect completion. More...
 
void * allocAsynchBuf (int *size)
 Obtain transport-owned writable storage for asynchronous sending. More...
 

Constructor & Destructor Documentation

◆ HttpConnection()

HttpConnection::HttpConnection ( )

Uninitialized storage; use HttpConnection_constructor before use.

Member Function Documentation

◆ clearKeepAlive()

void HttpConnection::clearKeepAlive ( )

Disable persistent connection reuse after the request completes.

Does not immediately close the socket.

◆ setKeepAlive()

void HttpConnection::setKeepAlive ( )

Enable persistent connection reuse after a completed HTTP request.