Barracuda Application Server C/C++ Reference
Native APIs, integration guides, and platform interfaces
SoDispCon.h File Reference
#include <ThreadLib.h>
#include <SoDisp.h>
Include dependency graph for SoDispCon.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  SoDispCon
 Contains information about the physical socket connection. More...
 

Macros

#define SoDispCon_socketHasNonBlockData(o)    (((o)->dataBits & SoDispCon_socketHasNonBlockDataBitMask) ? TRUE : FALSE)
 
#define SoDispCon_hasMoreData(o)    (((o)->dataBits & SoDispCon_hasMoreDataDataBitMask) ? TRUE : FALSE)
 
#define SoDispCon_dispatcherHasCon(o)    (((o)->dataBits & SoDispCon_dispatcherHasConDataBitMask)?TRUE:FALSE)
 
#define SoDispCon_recEvActive(o)    (((o)->dataBits & SoDispCon_recEvActiveDataBitMask)?TRUE:FALSE)
 
#define SoDispCon_sendEvActive(o)    (((o)->dataBits & SoDispCon_sendEvActiveDataBitMask)?TRUE:FALSE)
 
#define SoDispCon_isNonBlocking(o)    (((o)->dataBits & SoDispCon_isNonBlockingDataBitMask) ? TRUE : FALSE)
 
#define SoDispCon_isIP6(o)    (((o)->dataBits & SoDispCon_IP6DataBitMask) ? TRUE : FALSE)
 
#define SoDispCon_isDGRAM(o)    (((o)->dataBits & SoDispCon_DGramBitMask) ? TRUE : FALSE)
 
#define SoDispCon_isSecure(o)    ((o)->exec(o,0,SoDispCon_GetSharkSslCon,0,0) > 0)
 Test a successfully installed transport for TLS. More...
 
#define SoDispCon_getSharkSslCon(o, sharkSslConPtrPtr)    (o)->exec(o,0,SoDispCon_GetSharkSslCon,sharkSslConPtrPtr,0)
 Inspect a successfully installed transport. More...
 
#define SoDispCon_isValid(o)   HttpSocket_isValid(&(o)->httpSocket)
 
#define SoDispCon_getDispatcher(o)   (o)->dispatcher
 
#define SoDispCon_setDispSendEvent(o, dispSendEvFp)    (o)->dispSendEv=dispSendEvFp
 Install the send-ready callback before enabling events. More...
 
#define SoDispCon_setDispRecEvent(o, dispRecEvFp)    (o)->dispRecEv=dispRecEvFp
 Install the receive callback before enabling events. More...
 
#define SoDispCon_readData(o, data, len, relmutex)
 Read through the installed transport using its recorded readiness. More...
 
#define SoDispCon_asyncReady(o)    (o)->exec(o,0,SoDispCon_ExTypeAsyncReady,0,0)
 Advance any pending asynchronous send without modifying its payload. More...
 
#define SoDispCon_asyncSend(o, len)    (o)->exec(o,0,SoDispCon_ExTypeAsyncReady,0,len)
 Begin or advance a send from the transport's asynchronous buffer. More...
 
#define SoDispCon_destructor(o)   SoDispCon_zzCloseCon(o,1)
 Shut down and close the socket, disable events and remove registration. More...
 
#define SoDispCon_hardClose(o)   SoDispCon_zzCloseCon(o, 2)
 Abortively close the socket, disable events and remove registration. More...
 
#define SoDispCon_shutdown(o)   SoDispCon_zzCloseCon(o, 1)
 Shut down and close the socket, disable events and remove registration. More...
 
#define SoDispCon_closeCon(o)   SoDispCon_zzCloseCon(o, 0)
 Close the socket, disable events and remove registration. More...
 
#define SoDispCon_setReadTmo(o, timeout)   (o)->rtmo = (U16)((timeout)/50)
 Set the read wait timeout used by supported socket ports. More...
 
#define SoDispCon_getId(o)   HttpSocket_getId(&(o)->httpSocket)
 

Typedefs

typedef void(* SoDispCon_DispRecEv) (struct SoDispCon *con)
 Dispatcher receive notification, invoked with its mutex held. More...
 
typedef void(* SoDispCon_DispSendEv) (struct SoDispCon *con)
 Dispatcher send-ready notification, invoked with its mutex held. More...
 
typedef struct SoDispCon SoDispCon
 Contains information about the physical socket connection. More...
 

Functions

BA_API int SoDispCon_getSharkAlert (SoDispCon *o, U8 *alertLevel, U8 *alertDescription)
 Read the current SharkSSL alert fields. More...
 
BA_API void SoDispCon_constructor (SoDispCon *o, struct SoDisp *dispatcher, SoDispCon_DispRecEv e)
 Initialize an empty connection without opening a socket. More...
 
BA_API int SoDispCon_blockRead (SoDispCon *o, void *data, int len)
 Wait for input using a blocking connection. More...
 
BA_API int SoDispCon_sendData (SoDispCon *o, const void *data, int len)
 Send an entire buffer through the installed transport. More...
 
BA_API int SoDispCon_sendDataNT (SoDispCon *o, const void *data, int len)
 Send all bytes with the sendData contract, but omit body tracing. More...
 
BA_API int SoDispCon_sendDataX (SoDispCon *o, const void *data, int len)
 Send all bytes without releasing the dispatcher mutex. More...
 
BA_API int SoDispCon_sendChunkData (SoDispCon *o, const void *data, int len)
 Send one HTTP chunk, including its hexadecimal size and CRLF delimiters. More...
 
BA_API int SoDispCon_asyncReadyF (SoDispCon *o)
 Advance asynchronous sending; same status contract as SoDispCon_asyncReady. More...
 
BA_API void * SoDispCon_allocAsynchBuf (SoDispCon *o, int *size)
 Obtain transport-owned writable storage for asynchronous sending. More...
 
BA_API int SoDispCon_setNonblocking (SoDispCon *o)
 Select nonblocking socket mode. More...
 
BA_API int SoDispCon_setBlocking (SoDispCon *o)
 Select blocking socket mode. More...
 
BA_API int SoDispCon_moveCon (SoDispCon *o, SoDispCon *newCon)
 Move socket and transport ownership without copying object storage. More...
 
BA_API void SoDispCon_setTCPNoDelay (SoDispCon *o, int enable)
 Disable the TCP delay. More...
 
BA_API int SoDispCon_getPeerName (SoDispCon *o, HttpSockaddr *addr, U16 *port)
 Read the remote peer endpoint. More...
 
BA_API int SoDispCon_getSockName (SoDispCon *o, HttpSockaddr *addr, U16 *port)
 Read the local socket endpoint. More...
 
BA_API char * SoDispCon_addr2String (SoDispCon *o, HttpSockaddr *addr, char *buf, int len)
 Format a numeric address without a port number. More...
 
BA_API BaBool SoDispCon_cmpAddr (SoDispCon *o, HttpSockaddr *addr2)
 Compare an address with the current peer address, ignoring port numbers. More...
 
BA_API int SoDispCon_connect (SoDispCon *o, const char *host, U16 port, const void *bindIntfName, U16 bindPort, U32 timeout, BaBool dgram, BaBool ipv6, char **errinfo)
 Connect an initialized, empty connection to a remote endpoint. More...
 
BA_API int SoDispCon_asyncConnect (SoDispCon *o, const char *host, U16 port, const void *bindIntfName, BaBool ipv6, char **errinfo)
 Begin a TCP connection without waiting for TCP establishment. More...
 
BA_API int SoDispCon_asyncConnectNext (SoDispCon *o)
 Try the next resolved address after a failed pending connection. More...
 

Macro Definition Documentation

◆ SoDispCon_asyncReady

#define SoDispCon_asyncReady (   o)     (o)->exec(o,0,SoDispCon_ExTypeAsyncReady,0,0)

Advance any pending asynchronous send without modifying its payload.

Parameters
[in,out]oConnected object with an allocated asynchronous buffer.
Returns
1 complete, 0 pending, negative transport error. Does not itself register a send-ready callback.

◆ SoDispCon_asyncSend

#define SoDispCon_asyncSend (   o,
  len 
)     (o)->exec(o,0,SoDispCon_ExTypeAsyncReady,0,len)

Begin or advance a send from the transport's asynchronous buffer.

Parameters
[in]lenPositive payload byte count within the capacity returned by allocAsynchBuf for a new send. Do not alter the buffer until completion; use asyncReady to continue a pending send.
Returns
1 complete, 0 pending, negative transport error. For a plain socket with no asynchronous buffer, the implementation returns 1 without sending; always allocate and check the buffer before use.
Parameters
[in,out]oConnected object with an allocated asynchronous buffer.

◆ SoDispCon_closeCon

#define SoDispCon_closeCon (   o)    SoDispCon_zzCloseCon(o, 0)

Close the socket, disable events and remove registration.

Parameters
[in,out]oInitialized connection. Does not free object storage. No close result is reported; transport-owned buffers are invalidated.

◆ SoDispCon_destructor

#define SoDispCon_destructor (   o)    SoDispCon_zzCloseCon(o,1)

Shut down and close the socket, disable events and remove registration.

Parameters
[in,out]oInitialized connection. Does not free object storage. No close result is reported; transport-owned buffers are invalidated.

◆ SoDispCon_dispatcherHasCon

#define SoDispCon_dispatcherHasCon (   o)     (((o)->dataBits & SoDispCon_dispatcherHasConDataBitMask)?TRUE:FALSE)
Parameters
[in]oInitialized connection.
Returns
TRUE if registered with the dispatcher, FALSE otherwise.

◆ SoDispCon_getDispatcher

#define SoDispCon_getDispatcher (   o)    (o)->dispatcher
Parameters
[in]oInitialized connection.
Returns
Borrowed associated dispatcher, possibly NULL.

◆ SoDispCon_getId

#define SoDispCon_getId (   o)    HttpSocket_getId(&(o)->httpSocket)
Parameters
[in]oInitialized connection.
Returns
Platform socket identifier; not a portable persistent connection ID.

◆ SoDispCon_getSharkSslCon

#define SoDispCon_getSharkSslCon (   o,
  sharkSslConPtrPtr 
)     (o)->exec(o,0,SoDispCon_GetSharkSslCon,sharkSslConPtrPtr,0)

Inspect a successfully installed transport.

Parameters
[in]oConnected object with a valid transport implementation.
[out]sharkSslConPtrPtrOptional SharkSslCon** output, borrowed on success; NULL requests only the secure-transport test.
Returns
Transport test result; see SoDispCon::getSharkSslCon. The C macro preserves negative transport errors instead of converting them to bool.

◆ SoDispCon_hardClose

#define SoDispCon_hardClose (   o)    SoDispCon_zzCloseCon(o, 2)

Abortively close the socket, disable events and remove registration.

Parameters
[in,out]oInitialized connection. Does not free object storage. No close result is reported; transport-owned buffers are invalidated.

◆ SoDispCon_hasMoreData

#define SoDispCon_hasMoreData (   o)     (((o)->dataBits & SoDispCon_hasMoreDataDataBitMask) ? TRUE : FALSE)
Parameters
[in]oInitialized connection.
Returns
Recorded receive readiness; not a live probe or a byte count.

◆ SoDispCon_isDGRAM

#define SoDispCon_isDGRAM (   o)     (((o)->dataBits & SoDispCon_DGramBitMask) ? TRUE : FALSE)
Parameters
[in]oInitialized connection.
Returns
TRUE if recorded as datagram/UDP.

◆ SoDispCon_isIP6

#define SoDispCon_isIP6 (   o)     (((o)->dataBits & SoDispCon_IP6DataBitMask) ? TRUE : FALSE)
Parameters
[in]oInitialized connection.
Returns
TRUE if recorded as IPv6, FALSE for IPv4.

◆ SoDispCon_isNonBlocking

#define SoDispCon_isNonBlocking (   o)     (((o)->dataBits & SoDispCon_isNonBlockingDataBitMask) ? TRUE : FALSE)
Parameters
[in]oInitialized connection.
Returns
TRUE if the connection records nonblocking mode.

◆ SoDispCon_isSecure

#define SoDispCon_isSecure (   o)     ((o)->exec(o,0,SoDispCon_GetSharkSslCon,0,0) > 0)

Test a successfully installed transport for TLS.

Parameters
[in]oConnected object with an installed transport.
Returns
TRUE if the transport reports secure, FALSE otherwise. Does not establish handshake completion, certificate trust or peer identity.

◆ SoDispCon_isValid

#define SoDispCon_isValid (   o)    HttpSocket_isValid(&(o)->httpSocket)
Parameters
[in]oInitialized connection.
Returns
TRUE if a socket handle is installed; not a peer-liveness test.

◆ SoDispCon_readData

#define SoDispCon_readData (   o,
  data,
  len,
  relmutex 
)
Value:
(o)->exec(o, (relmutex) ? SoDisp_getMutex((o)->dispatcher) : 0, \
SoDispCon_ExTypeRead,data,len)
#define SoDisp_getMutex(o)
Definition: SoDisp.h:215

Read through the installed transport using its recorded readiness.

Parameters
[out]dataRequired writable buffer; returned bytes are not NUL-terminated.
[in]lenPositive capacity in bytes.
[in]relmutexTrue allows the transport to release the owned dispatcher mutex while waiting, then reacquire it; false (default) keeps it held.
Returns
Positive byte count (possibly short), zero for no data, or negative transport/timeout error. Do not run concurrent reads on one connection.
Parameters
[in,out]oConnected object with an installed transport.

◆ SoDispCon_recEvActive

#define SoDispCon_recEvActive (   o)     (((o)->dataBits & SoDispCon_recEvActiveDataBitMask)?TRUE:FALSE)
Parameters
[in]oInitialized connection.
Returns
TRUE if receive events are enabled.

◆ SoDispCon_sendEvActive

#define SoDispCon_sendEvActive (   o)     (((o)->dataBits & SoDispCon_sendEvActiveDataBitMask)?TRUE:FALSE)
Parameters
[in]oInitialized connection.
Returns
TRUE if send-ready events are enabled.

◆ SoDispCon_setDispRecEvent

#define SoDispCon_setDispRecEvent (   o,
  dispRecEvFp 
)     (o)->dispRecEv=dispRecEvFp

Install the receive callback before enabling events.

Parameters
[in,out]oInitialized connection.
[in]dispRecEvFpRequired callback while receive events are active.

◆ SoDispCon_setDispSendEvent

#define SoDispCon_setDispSendEvent (   o,
  dispSendEvFp 
)     (o)->dispSendEv=dispSendEvFp

Install the send-ready callback before enabling events.

Parameters
[in,out]oInitialized connection.
[in]dispSendEvFpRequired callback while send events are active.

◆ SoDispCon_setReadTmo

#define SoDispCon_setReadTmo (   o,
  timeout 
)    (o)->rtmo = (U16)((timeout)/50)

Set the read wait timeout used by supported socket ports.

Parameters
[in,out]oConnected object.
[in]timeoutNonnegative integer milliseconds, at most 3276750. Stored as U16 units of 50 ms, rounding down; values below 50 disable the timeout. Zero means no timeout. Some read paths consume/reset the setting; SoDispCon_blockRead restores it during its internal TLS retries.

◆ SoDispCon_shutdown

#define SoDispCon_shutdown (   o)    SoDispCon_zzCloseCon(o, 1)

Shut down and close the socket, disable events and remove registration.

Parameters
[in,out]oInitialized connection. Does not free object storage. No close result is reported; transport-owned buffers are invalidated.

◆ SoDispCon_socketHasNonBlockData

#define SoDispCon_socketHasNonBlockData (   o)     (((o)->dataBits & SoDispCon_socketHasNonBlockDataBitMask) ? TRUE : FALSE)
Parameters
[in]oInitialized connection.
Returns
TRUE if socket readiness has been recorded, FALSE otherwise.

Typedef Documentation

◆ SoDispCon

typedef struct SoDispCon SoDispCon

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.

◆ SoDispCon_DispRecEv

typedef void(* SoDispCon_DispRecEv) (struct SoDispCon *con)

Dispatcher receive notification, invoked with its mutex held.

Parameters
[in,out]conBorrowed registered connection. Check operation results; readiness does not guarantee successful I/O. Stop events before freeing it.

◆ SoDispCon_DispSendEv

typedef void(* SoDispCon_DispSendEv) (struct SoDispCon *con)

Dispatcher send-ready notification, invoked with its mutex held.

Parameters
[in,out]conBorrowed registered connection. Check operation results; readiness does not guarantee successful I/O. Stop events before freeing it.

Function Documentation

◆ SoDispCon_addr2String()

BA_API char * SoDispCon_addr2String ( SoDispCon o,
HttpSockaddr *  addr,
char *  buf,
int  len 
)

Format a numeric address without a port number.

Parameters
[in]addrRequired address with the same family as this connection.
[out]bufRequired writable storage for a NUL-terminated result.
[in]lenCapacity in bytes including NUL; at least 16 for IPv4 or 46 for IPv6. Always provide writable storage even if capacity is rejected.
Returns
buf on success, NULL on invalid storage, family mismatch or conversion failure. No allocation is performed; do not use the output after failure.
Parameters
[in,out]oInitialized connection.

◆ SoDispCon_allocAsynchBuf()

BA_API void * SoDispCon_allocAsynchBuf ( SoDispCon o,
int *  size 
)

Obtain transport-owned writable storage for asynchronous sending.

Parameters
[in,out]sizeRequired positive requested capacity in bytes; receives the actual capacity, which may differ. Always use the returned capacity.
Returns
Borrowed writable storage, or NULL if allocation fails. Requires a valid connected transport. Do not free it; close or transport buffer release invalidates it. Do not reallocate while an earlier send is pending.
Parameters
[in,out]oInitialized connection.

◆ SoDispCon_asyncConnect()

BA_API int SoDispCon_asyncConnect ( SoDispCon o,
const char *  host,
U16  port,
const void *  bindIntfName,
BaBool  ipv6,
char **  errinfo 
)

Begin a TCP connection without waiting for TCP establishment.

DNS resolution can still block. Available unless NO_ASYNCH_RESP is defined.

Parameters
[in,out]oInitialized empty connection with no transport buffer/TLS state. Keep it alive until the attempt completes or is cleaned up.
[in]hostRequired NUL-terminated hostname or numeric address.
[in]portRemote port in host byte order, 1..65535.
[in]bindIntfNameBorrowed local interface/address, or NULL for default; copied when the resolver keeps state for additional address attempts.
[in]ipv6TRUE requests IPv6, FALSE IPv4.
[out]errinfoOptional borrowed resolver-text output, initially NULL.
Returns
1 connected immediately, 0 connection pending, negative error. Register send-ready handling and check socket completion before sending. With USE_ADDRINFO, release connect state before TLS upgrade, asynchronous buffer allocation, or final socket cleanup. See asyncConnectRelease.
Warning
The current USE_ADDRINFO allocation-failure path can also return zero without retaining pending state. Do not assume that zero alone establishes that another address attempt is available.

◆ SoDispCon_asyncConnectNext()

BA_API int SoDispCon_asyncConnectNext ( SoDispCon o)

Try the next resolved address after a failed pending connection.

Parameters
[in,out]oConnection with live USE_ADDRINFO pending-connect state. Call only after the current attempt fails; do not use as a readiness poll.
Returns
1 connected, 0 pending, negative error. Without USE_ADDRINFO, returns E_CANNOT_CONNECT because no address-list state is retained.

◆ SoDispCon_asyncReadyF()

BA_API int SoDispCon_asyncReadyF ( SoDispCon o)

Advance asynchronous sending; same status contract as SoDispCon_asyncReady.

Parameters
[in,out]oConnected object with an allocated asynchronous buffer.
Returns
1 complete, 0 pending, negative transport error.

◆ SoDispCon_blockRead()

BA_API int SoDispCon_blockRead ( SoDispCon o,
void *  data,
int  len 
)

Wait for input using a blocking connection.

Parameters
[in,out]oConnected object in blocking mode; no competing reader.
[out]dataRequired writable storage, not NUL-terminated on return.
[in]lenPositive capacity in bytes.
Returns
Positive byte count, zero when the transport supplies no data, negative error (including timeout). Does not guarantee a full buffer. Allows the owned dispatcher mutex to be released and reacquired while waiting.

◆ SoDispCon_cmpAddr()

BA_API BaBool SoDispCon_cmpAddr ( SoDispCon o,
HttpSockaddr *  addr2 
)

Compare an address with the current peer address, ignoring port numbers.

Parameters
[in]addr2Required address to compare; IPv4-mapped IPv6 is recognized.
Returns
True if equal, false if different or the peer address lookup fails.
Parameters
[in,out]oInitialized connection.

◆ SoDispCon_connect()

BA_API int SoDispCon_connect ( SoDispCon o,
const char *  host,
U16  port,
const void *  bindIntfName,
U16  bindPort,
U32  timeout,
BaBool  dgram,
BaBool  ipv6,
char **  errinfo 
)

Connect an initialized, empty connection to a remote endpoint.

Parameters
[in]hostRequired NUL-terminated hostname or numeric IP address.
[in]portRemote TCP/UDP port in host byte order, 1..65535.
[in]bindIntfNameOptional borrowed platform local interface/address used during the call; NULL selects the default.
[in]bindPortLocal port in host byte order; zero lets the OS choose.
[in]timeoutPositive connect timeout in milliseconds, default 1500. The legacy resolver path ignores this value; USE_ADDRINFO applies it to individual address attempts, not the entire DNS-and-connect operation.
[in]dgramTRUE selects UDP, FALSE TCP (default).
[in]ipv6TRUE requests IPv6, FALSE IPv4 (default); resolution depends on the selected network port.
[out]errinfoOptional output for borrowed platform resolver text; initialized to NULL. Do not free it or rely on text as a stable error code.
Returns
Zero on success, negative socket/resolver error on failure. The owned dispatcher mutex is released around resolution/connect and acquired again before return. Do not use the connection concurrently during this call. Failure can require cleanup; no socket ownership is returned to the caller.
Parameters
[in,out]oInitialized empty connection.

◆ SoDispCon_constructor()

BA_API void SoDispCon_constructor ( SoDispCon o,
struct SoDisp dispatcher,
SoDispCon_DispRecEv  e 
)

Initialize an empty connection without opening a socket.

Parameters
[out]oCaller-owned storage.
[in]dispatcherBorrowed dispatcher, or NULL for independent use.
[in]eReceive callback, required before enabling receive events. Install a transport by connecting or moving in an accepted connection.

◆ SoDispCon_getPeerName()

BA_API int SoDispCon_getPeerName ( SoDispCon o,
HttpSockaddr *  addr,
U16 port 
)

Read the remote peer endpoint.

Parameters
[out]addrRequired address output, valid only on success.
[out]portOptional port output in host byte order; NULL omits it.
Returns
Zero on success, nonzero platform socket status on failure.
Parameters
[in,out]oInitialized connection.

◆ SoDispCon_getSharkAlert()

BA_API int SoDispCon_getSharkAlert ( SoDispCon o,
U8 alertLevel,
U8 alertDescription 
)

Read the current SharkSSL alert fields.

Parameters
[in]oConnection known to use SharkSSL, not a plain socket with an asynchronous buffer or a pending connect operation.
[out]alertLevelRequired U8 output, valid on success.
[out]alertDescriptionRequired U8 output, valid on success.
Returns
Zero if TLS state exists, -1 otherwise. Does not clear the alert. Available with the SharkSSL transport wrapper.

◆ SoDispCon_getSockName()

BA_API int SoDispCon_getSockName ( SoDispCon o,
HttpSockaddr *  addr,
U16 port 
)

Read the local socket endpoint.

Parameters
[out]addrRequired address output, valid only on success.
[out]portOptional port output in host byte order; NULL omits it.
Returns
Zero on success, nonzero platform socket status on failure.
Parameters
[in,out]oInitialized connection.

◆ SoDispCon_moveCon()

BA_API int SoDispCon_moveCon ( SoDispCon o,
SoDispCon newCon 
)

Move socket and transport ownership without copying object storage.

Parameters
[in,out]oSource connection; receive/send events are deactivated and it is removed from dispatcher registration during the move.
[in,out]newConInitialized empty destination with dispatcher and event callbacks already configured. Do not overwrite a live destination socket.
Returns
Zero. Register/activate the destination separately as required.

◆ SoDispCon_sendChunkData()

BA_API int SoDispCon_sendChunkData ( SoDispCon o,
const void *  data,
int  len 
)

Send one HTTP chunk, including its hexadecimal size and CRLF delimiters.

Parameters
[in]dataBorrowed source containing len readable bytes.
[in]lenByte count from 0 through 65535. Zero sends the final empty chunk.
Returns
Zero on success, -1 on header, payload or delimiter send failure. Partial wire output can already exist on failure.
Parameters
[in,out]oInitialized connection.

◆ SoDispCon_sendData()

BA_API int SoDispCon_sendData ( SoDispCon o,
const void *  data,
int  len 
)

Send an entire buffer through the installed transport.

Parameters
[in]dataBorrowed source containing len readable bytes.
[in]lenNonnegative byte count.
Returns
Zero only if the transport reports the complete byte count; -1 for an invalid socket, E_SOCKET_WRITE_FAILED for a failed or short send. No partial count is supplied. May release/reacquire the dispatcher mutex. Use the async buffer API for nonblocking partial-send handling.
Parameters
[in,out]oInitialized connection.

◆ SoDispCon_sendDataNT()

BA_API int SoDispCon_sendDataNT ( SoDispCon o,
const void *  data,
int  len 
)

Send all bytes with the sendData contract, but omit body tracing.

Parameters
[in,out]oConnected object.
[in]dataBorrowed source containing len bytes.
[in]lenNonnegative byte count.
Returns
Zero complete, -1 invalid socket, E_SOCKET_WRITE_FAILED short/error. No partial count is returned. May release/reacquire the dispatcher mutex.

◆ SoDispCon_sendDataX()

BA_API int SoDispCon_sendDataX ( SoDispCon o,
const void *  data,
int  len 
)

Send all bytes without releasing the dispatcher mutex.

Parameters
[in,out]oConnected object; caller manages synchronization.
[in]dataBorrowed source containing len readable bytes.
[in]lenNonnegative byte count.
Returns
Zero complete, -1 invalid socket, E_SOCKET_WRITE_FAILED short/error.

◆ SoDispCon_setBlocking()

BA_API int SoDispCon_setBlocking ( SoDispCon o)

Select blocking socket mode.

Returns
Zero success, -1 if already blocking, or a platform failure status.
Parameters
[in,out]oInitialized connection.

◆ SoDispCon_setNonblocking()

BA_API int SoDispCon_setNonblocking ( SoDispCon o)

Select nonblocking socket mode.

Returns
Zero success, -1 if already nonblocking, or a platform failure status. The recorded mode changes only when the platform operation succeeds.
Parameters
[in,out]oInitialized connection.

◆ SoDispCon_setTCPNoDelay()

BA_API void SoDispCon_setTCPNoDelay ( SoDispCon o,
int  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.

Parameters
[in]enableTrue disables Nagle; false enables it. No socket-option error status is returned; errors can be traced.
[in,out]oInitialized connection.