Barracuda Application Server C/C++ Reference
NO
SoDispCon 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 <SoDispCon.h>

Inheritance diagram for SoDispCon:

Public Member Functions

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 to host/IP address. More...
 
bool isSecure ()
 Deprecated: Use getSharkSslCon(NULL).
 
bool getSharkSslCon (SharkSslCon **sc)
 Returns true if this is an SSL connection. More...
 
bool isValid ()
 Returns true if the socket connection is valid.
 
bool isIP6 ()
 Returns true if this is an IP version 6 connection.
 
int getPeerName (HttpSockaddr *addr, U16 *port=0)
 Returns the 'peer' IP address. More...
 
int getSockName (HttpSockaddr *addr, U16 *port=0)
 Returns the 'sock' IP address. More...
 
char * addr2String (HttpSockaddr *addr, char *buf, int len)
 Converts IP address to string.
 
bool cmpAddr (HttpSockaddr *addr2)
 Compare addr with address returned by getPeerName.
 
void setTCPNoDelay (bool enable)
 Disable the TCP delay. More...
 
struct SoDispgetDispatcher ()
 Fetch the SoDisp object.
 
bool hasMoreData ()
 Returns true if more data on the socket.
 
bool dispatcherHasCon ()
 Returns true if connection is in the SoDisp object.
 
bool recEvActive ()
 Returns true if the connection is active in the SoDisp object.
 
bool sendEvActive ()
 Used for non blocking send.
 

Member Function Documentation

◆ connect()

int SoDispCon::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 to host/IP address.

Parameters
hostthe host/IP address.
portthe port number or service.
bindIntfNamethe interface to bind this socket to.
dgramdefaults to false (TCP).
bindPortoptionally bind to specific port
timeoutin milliseconds
ipv6defaults to false.
errinfomay be set to platform error.
Returns
0 on success and < 0 on error: sock error code.

◆ getPeerName()

int SoDispCon::getPeerName ( HttpSockaddr *  addr,
U16 *  port = 0 
)

Returns the 'peer' IP address.

Returns
the IP address in the 'addr' argument.

◆ getSharkSslCon()

bool SoDispCon::getSharkSslCon ( SharkSslCon **  sc)

Returns true if this is an SSL connection.

Parameters
scis set to the SharkSslCon object.

◆ getSockName()

int SoDispCon::getSockName ( HttpSockaddr *  addr,
U16 *  port = 0 
)

Returns the 'sock' IP address.

Returns
the IP address in the 'addr' argument.

◆ setTCPNoDelay()

void SoDispCon::setTCPNoDelay ( bool  enable)

Disable the TCP delay.

What TCP normally does is queue up data so it only sends full packets out when possible. (This is called Nagle’s algorithm.) Call this function if you do not want that behavior.