Barracuda Application Server C/C++ Reference
Native APIs, integration guides, and platform interfaces
SoDispCon.h
Go to the documentation of this file.
1/*
2 * ____ _________ __ _
3 * / __ \___ ____ _/ /_ __(_)___ ___ ___ / / ____ ____ _(_)____
4 * / /_/ / _ \/ __ `/ / / / / / __ `__ \/ _ \/ / / __ \/ __ `/ / ___/
5 * / _, _/ __/ /_/ / / / / / / / / / / / __/ /___/ /_/ / /_/ / / /__
6 * /_/ |_|\___/\__,_/_/ /_/ /_/_/ /_/ /_/\___/_____/\____/\__, /_/\___/
7 * /____/
8 *
9 * Barracuda Embedded Web-Server
10 *
11 ****************************************************************************
12 * HEADER
13 *
14 * $Id: SoDispCon.h 5978 2026-09-11 16:13:48Z wini $
15 *
16 * COPYRIGHT: Real Time Logic LLC, 2006 - 2026
17 *
18 * This software is copyrighted by and is the sole property of Real
19 * Time Logic LLC. All rights, title, ownership, or other interests in
20 * the software remain the property of Real Time Logic LLC. This
21 * software may only be used in accordance with the terms and
22 * conditions stipulated in the corresponding license agreement under
23 * which the software has been supplied. Any unauthorized use,
24 * duplication, transmission, distribution, or disclosure of this
25 * software is expressly forbidden.
26 *
27 * This Copyright notice may not be removed or modified without prior
28 * written consent of Real Time Logic LLC.
29 *
30 * Real Time Logic LLC. reserves the right to modify this software
31 * without notice.
32 *
33 * http://www.realtimelogic.com
34 ****************************************************************************
35 *
36 *
37 */
38
41#ifndef __SoDispCon_h
42#define __SoDispCon_h
43
44#include <ThreadLib.h>
45#include <SoDisp.h>
46
47struct SharkSslCon;
48
49/*===========================================================================
50 *
51 * SoDispCon
52 *---------------------------------------------------------------------------
53 */
54
55
56
57/* SoDispCon_ExType -> SoDispCon Execute Type.
58 The callback function SoDispCon_Execute in SoDispCon is
59 like having 6 callback functions. SoDispCon_ExType specifies the
60 current callback type.
61 This construction preserves memory as we have 1 callback function pointer
62 instead of 5.
63
64 ExStateRead: read socket data
65 ExStateWrite: write socket data
66 GetSharkSslCon: return the internal SharkSsslCon object
67 ExStateClose: Close connection.
68 ExStateMoveCon: Moving the active connection to another SoDispCon obj.
69 ExStateDispEv: The socket dispatcher signals that data is ready.
70*/
71typedef enum {
72 SoDispCon_ExTypeRead=1,
73 SoDispCon_ExTypeWrite,
74 SoDispCon_GetSharkSslCon,
75 SoDispCon_ExTypeClose,
76 SoDispCon_ExTypeMoveCon,
77 SoDispCon_ExTypeAllocAsynchBuf,
78 SoDispCon_ExTypeAsyncReady,
79 SoDispCon_ExTypeIdle
80} SoDispCon_ExType;
81
82
83/*
84The arguments to the SoDispCon_Execute callback function:
85 SoDispCon_ExTypeRead:
86 d1 pointer to data, d2 length of data, ret #of bytes read, < 0 if failed
87 or 0 if no data.
88 SoDispCon_ExTypeWrite:
89 d1 pointer to data, d2 length, ret < 0 if failed or #of bytes written.
90 SoDispCon_GetSharkSslCon:
91 d1 is pointer pointer to SharkSslCon, d2 not used, ret TRUE of FALSE.
92 SoDispCon_ExTypeClose:
93 d1 not used, d2 not used, ret is void.
94 SoDispCon_ExTypeMoveCon:
95 d1 is a pointer to a SoDispCon object.
96*/
97
98struct SoDispCon;
99struct SharkSsl;
100
101typedef int (*SoDispCon_Execute)(
102 struct SoDispCon* con, ThreadMutex* m,SoDispCon_ExType s,void* d1,int d2);
103
104
108typedef void (*SoDispCon_DispRecEv)(struct SoDispCon* con);
112typedef void (*SoDispCon_DispSendEv)(struct SoDispCon* con);
113
114
119typedef struct SoDispCon
120{
121#ifdef __cplusplus
122 void *operator new(size_t, void *place) { return place; }
123 void operator delete(void*, void *) { }
126
127
148 int connect(const char* host,
149 U16 port,
150 const void* bindIntfName=0,
151 U16 bindPort=0,
152 U32 timeout=1500,
153 BaBool dgram=false, BaBool ipv6=false,
154 char** errinfo=0);
155
158 bool isSecure();
159
168 bool getSharkSslCon(SharkSslCon** sc);
169
170
174 bool isValid();
175
177 bool isIP6();
178
184 int getPeerName(HttpSockaddr* addr,U16* port=0);
185
191 int getSockName(HttpSockaddr* addr,U16* port=0);
192
201 char* addr2String(HttpSockaddr* addr, char* buf, int len);
202
207 bool cmpAddr(HttpSockaddr* addr2);
208
216 void setTCPNoDelay(bool enable);
217
220 struct SoDisp* getDispatcher();
221
224 bool hasMoreData();
225
228 bool dispatcherHasCon();
229
232 bool recEvActive();
233
236 bool sendEvActive();
237
251 int readData(void* data, int len, bool relmutex=false);
255 int setNonblocking();
258 int setBlocking();
266 int sendData(const void* data, int len);
274 int asyncSend(int len);
280 int sendChunkData(const void* data, int len);
285 int asyncReady();
292 void* allocAsynchBuf(int* size);
293#endif
294 CONNECTION_DISPATCHER_OBJ /*Owned and handled by the SoDisp obj.*/
295
296 /* Owned and handled by SSL. */
297 void* sslData;
298 SoDispCon_Execute exec;
299
300 HttpSocket httpSocket;
301 SoDispCon_DispRecEv dispRecEv;
302 SoDispCon_DispSendEv dispSendEv;
303 struct SoDisp* dispatcher;
304 BaBool* sendTermPtr;
305 BaBool* recTermPtr;
306 U16 rtmo; /* Read timeout in 50 millisec intervals */
307 U8 dataBits;
308 U8 isSending;
310
311#define SoDispCon_socketHasNonBlockDataBitMask 0x01
312#define SoDispCon_hasMoreDataDataBitMask 0x02
313
314#define SoDispCon_dispatcherHasConDataBitMask 0x04
315#define SoDispCon_recEvActiveDataBitMask 0x08
316#define SoDispCon_sendEvActiveDataBitMask 0x10
317#define SoDispCon_isNonBlockingDataBitMask 0x20
318#define SoDispCon_IP6DataBitMask 0x40
319#define SoDispCon_DGramBitMask 0x80
320
321#define SoDispCon_setDispHasRecData(o)\
322 ((o)->dataBits |= \
323 (SoDispCon_hasMoreDataDataBitMask | SoDispCon_socketHasNonBlockDataBitMask))
324#define SoDispCon_setDispatcherHasCon(o)\
325 ((o)->dataBits |= SoDispCon_dispatcherHasConDataBitMask)
326#define SoDispCon_setRecEvActive(o)\
327 ((o)->dataBits |= SoDispCon_recEvActiveDataBitMask)
328#define SoDispCon_setSendEvActive(o)\
329 ((o)->dataBits |= SoDispCon_sendEvActiveDataBitMask)
330#define SoDispCon_setIP6(o)\
331 ((o)->dataBits |= SoDispCon_IP6DataBitMask)
332
333#define SoDispCon_clearSocketHasNonBlockData(o)\
334 ((o)->dataBits &= ~(U8)SoDispCon_socketHasNonBlockDataBitMask)
335#define SoDispCon_clearHasMoreData(o)\
336 ((o)->dataBits &= ~(U8)SoDispCon_hasMoreDataDataBitMask)
337#define SoDispCon_clearDispatcherHasCon(o)\
338 ((o)->dataBits &= ~(U8)SoDispCon_dispatcherHasConDataBitMask)
339#define SoDispCon_setRecEvInactive(o)\
340 ((o)->dataBits &= ~(U8)SoDispCon_recEvActiveDataBitMask)
341#define SoDispCon_setSendEvInactive(o)\
342 ((o)->dataBits &= ~(U8)SoDispCon_sendEvActiveDataBitMask)
343#define SoDispCon_clearIP6(o)\
344 ((o)->dataBits &= ~(U8)SoDispCon_IP6DataBitMask)
345
348#define SoDispCon_socketHasNonBlockData(o)\
349 (((o)->dataBits & SoDispCon_socketHasNonBlockDataBitMask) ? TRUE : FALSE)
352#define SoDispCon_hasMoreData(o)\
353 (((o)->dataBits & SoDispCon_hasMoreDataDataBitMask) ? TRUE : FALSE)
356#define SoDispCon_dispatcherHasCon(o)\
357 (((o)->dataBits & SoDispCon_dispatcherHasConDataBitMask)?TRUE:FALSE)
360#define SoDispCon_recEvActive(o)\
361 (((o)->dataBits & SoDispCon_recEvActiveDataBitMask)?TRUE:FALSE)
364#define SoDispCon_sendEvActive(o)\
365 (((o)->dataBits & SoDispCon_sendEvActiveDataBitMask)?TRUE:FALSE)
368#define SoDispCon_isNonBlocking(o)\
369 (((o)->dataBits & SoDispCon_isNonBlockingDataBitMask) ? TRUE : FALSE)
370#ifndef SoDispCon_isIP6
373#define SoDispCon_isIP6(o)\
374 (((o)->dataBits & SoDispCon_IP6DataBitMask) ? TRUE : FALSE)
377#define SoDispCon_isDGRAM(o) \
378 (((o)->dataBits & SoDispCon_DGramBitMask) ? TRUE : FALSE)
379#endif
384#define SoDispCon_isSecure(o) \
385 ((o)->exec(o,0,SoDispCon_GetSharkSslCon,0,0) > 0)
392#define SoDispCon_getSharkSslCon(o,sharkSslConPtrPtr) \
393 (o)->exec(o,0,SoDispCon_GetSharkSslCon,sharkSslConPtrPtr,0)
396#define SoDispCon_isValid(o) HttpSocket_isValid(&(o)->httpSocket)
397#define SoDispCon_invalidate(o) HttpSocket_invalidate(&(o)->httpSocket)
400#define SoDispCon_getDispatcher(o) (o)->dispatcher
401#define SoDispCon_dispRecEvent(o) (o)->dispRecEv(o)
402#define SoDispCon_dispSendEvent(o) (o)->dispSendEv(o)
406#define SoDispCon_setDispSendEvent(o, dispSendEvFp) \
407 (o)->dispSendEv=dispSendEvFp
408
412#define SoDispCon_setDispRecEvent(o, dispRecEvFp) \
413 (o)->dispRecEv=dispRecEvFp
414
417#define SoDispCon_readData(o, data, len, relmutex) \
418 (o)->exec(o, (relmutex) ? SoDisp_getMutex((o)->dispatcher) : 0, \
419 SoDispCon_ExTypeRead,data,len)
420
421/* The HttpServCon (and classes inherited from HttpServCon) calls the
422 * newConnectionIsReady function after a successful call to
423 * HttpSocket_accept and after the new connection is installed in the
424 * web-server. This is a platform dependent function and is, by default,
425 * disabled as few platforms need this.
426 */
427#ifndef SoDispCon_newConnectionIsReady
428#define SoDispCon_newConnectionIsReady(con)
429#endif
430
439 SoDispCon* o, U8* alertLevel, U8* alertDescription);
440
441#ifdef __cplusplus
442extern "C" {
443#endif
450 SoDispCon* o, struct SoDisp* dispatcher, SoDispCon_DispRecEv e);
451BA_API int SoDispCon_upgrade(SoDispCon* o, struct SharkSsl* ssl,
452 const char* alpn, const char* host, int port);
460BA_API int SoDispCon_blockRead(SoDispCon* o,void* data,int len);
463BA_API int SoDispCon_sendData(SoDispCon* o, const void* data, int len);
470BA_API int SoDispCon_sendDataNT(SoDispCon* o, const void* data, int len);
476BA_API int SoDispCon_sendDataX(SoDispCon* o, const void* data, int len);
479BA_API int SoDispCon_sendChunkData(SoDispCon* o,const void* data, int len);
488#define SoDispCon_asyncReady(o)\
489 (o)->exec(o,0,SoDispCon_ExTypeAsyncReady,0,0)
492#define SoDispCon_asyncSend(o, len) \
493 (o)->exec(o,0,SoDispCon_ExTypeAsyncReady,0,len)
494struct AllocatorIntf;
495
496#ifndef __DOXYGEN__
497typedef struct
498{
499 void* retVal;
500 int size;
501} AllocAsynchBufArgs;
502#endif
503
506BA_API void* SoDispCon_allocAsynchBuf(SoDispCon* o, int* size);
507BA_API void SoDispCon_releaseAsyncBuf(SoDispCon* con);
508BA_API void SoDispCon_internalAllocAsynchBuf(
509 SoDispCon* con, AllocAsynchBufArgs* args);
516BA_API int SoDispCon_peek(SoDispCon* o);
523BA_API int SoDispCon_moveCon(SoDispCon* o, SoDispCon* newCon);
527#define SoDispCon_destructor(o) SoDispCon_zzCloseCon(o,1)
531#define SoDispCon_hardClose(o) SoDispCon_zzCloseCon(o, 2)
535#define SoDispCon_shutdown(o) SoDispCon_zzCloseCon(o, 1)
539#define SoDispCon_closeCon(o) SoDispCon_zzCloseCon(o, 0)
546#define SoDispCon_setReadTmo(o,timeout) (o)->rtmo = (U16)((timeout)/50)
547BA_API void SoDispCon_zzCloseCon(SoDispCon* o, int shutdown);
550BA_API void SoDispCon_setTCPNoDelay(SoDispCon* o, int enable);
553BA_API int SoDispCon_getPeerName(SoDispCon* o,HttpSockaddr* addr,U16* port);
556BA_API int SoDispCon_getSockName(SoDispCon* o, HttpSockaddr* addr, U16* port);
560 SoDispCon* o, HttpSockaddr* addr, char* buf, int len);
563BA_API BaBool SoDispCon_cmpAddr(SoDispCon* o, HttpSockaddr* addr2);
564BA_API void SoDispCon_printSockErr(
565 SoDispCon* o,const char* type,HttpSocket* s,int status);
568#define SoDispCon_getId(o) HttpSocket_getId(&(o)->httpSocket)
569/* Internal */
570#ifndef SoDispCon_platReadData
571int SoDispCon_platReadData(SoDispCon* o, ThreadMutex* m, BaBool* isTerminated,
572 void* data, int len);
573#endif
574
577BA_API int
579 const char* host,
580 U16 port,
581 const void* bindIntfName,
582 U16 bindPort,
583 U32 timeout,
584 BaBool dgram, BaBool ipv6,
585 char** errinfo);
586#ifndef NO_ASYNCH_RESP
604BA_API int
606 const char* host,
607 U16 port,
608 const void* bindIntfName,
609 BaBool ipv6,
610 char** errinfo);
617#ifdef USE_ADDRINFO
622BA_API void SoDispCon_asyncConnectRelease(SoDispCon* o);
623#else
624#define SoDispCon_asyncConnectRelease(o)
625#endif
626
627#endif
628#ifdef __cplusplus
629}
630inline int SoDispCon::readData(void* data, int len, bool relmutex) {
631 return SoDispCon_readData(this, data, len, relmutex ? TRUE : FALSE); }
633 return SoDispCon_setNonblocking(this); }
635 return SoDispCon_setBlocking(this); }
636inline bool SoDispCon::isSecure() {
637 return SoDispCon_isSecure(this) ? true : false; }
638inline bool SoDispCon::getSharkSslCon(SharkSslCon** sc) {
639 return SoDispCon_getSharkSslCon(this,sc) ? true : false; }
640inline bool SoDispCon::isIP6() {
641 return SoDispCon_isIP6(this) ? true : false; }
642inline bool SoDispCon::isValid() {
643 return SoDispCon_isValid(this) ? true : false; }
644inline int SoDispCon::getPeerName(HttpSockaddr* addr,U16* port){
645 return SoDispCon_getPeerName(this,addr,port); }
646inline int SoDispCon::getSockName(HttpSockaddr* addr,U16* port){
647 return SoDispCon_getSockName(this, addr,port); }
648inline char* SoDispCon::addr2String(HttpSockaddr* addr,char* buf,int len){
649 return SoDispCon_addr2String(this, addr, buf, len); }
650inline bool SoDispCon::cmpAddr(HttpSockaddr* addr2) {
651 return SoDispCon_cmpAddr(this, addr2) ? true : false;
652}
653inline void SoDispCon::setTCPNoDelay(bool enable) {
654 SoDispCon_setTCPNoDelay(this, enable); }
656 return SoDispCon_hasMoreData(this) ? true : false;
657}
659 return SoDispCon_dispatcherHasCon(this) ? true : false; }
661 return SoDispCon_recEvActive(this) ? true : false; }
663 return SoDispCon_sendEvActive(this) ? true : false; }
665 return SoDispCon_getDispatcher(this); }
667 SoDispCon_setDispSendEvent(this, ev); }
669 SoDispCon_setDispRecEvent(this, ev); }
670inline int SoDispCon::sendData(const void* data, int len) {
671 return SoDispCon_sendData(this,data, len); }
672inline int SoDispCon::asyncSend(int len) {
673 return SoDispCon_asyncSend(this, len); }
674inline int SoDispCon::sendChunkData(const void* data, int len) {
675 return SoDispCon_sendChunkData(this, data, len); }
677 return SoDispCon_asyncReadyF(this) ? true : false; }
678inline void* SoDispCon::allocAsynchBuf(int* size){
679 return SoDispCon_allocAsynchBuf(this, size); }
680inline int SoDispCon::connect(const char* host,
681 U16 port,
682 const void* bindIntfName,
683 U16 bindPort,
684 U32 timeout,
685 BaBool dgram, BaBool ipv6,
686 char** errinfo) {
687 return SoDispCon_connect(this,host,port, bindIntfName,bindPort,timeout,
688 dgram?TRUE:FALSE, ipv6?TRUE:FALSE,errinfo);
689}
690#endif
691
692
693#endif
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.
BA_API int SoDispCon_setBlocking(SoDispCon *o)
Select blocking socket mode.
#define SoDispCon_setDispRecEvent(o, dispRecEvFp)
Install the receive callback before enabling events.
Definition: SoDispCon.h:412
#define SoDispCon_asyncSend(o, len)
Begin or advance a send from the transport's asynchronous buffer.
Definition: SoDispCon.h:492
BA_API int SoDispCon_sendDataX(SoDispCon *o, const void *data, int len)
Send all bytes without releasing the dispatcher mutex.
BA_API int SoDispCon_blockRead(SoDispCon *o, void *data, int len)
Wait for input using a blocking connection.
#define SoDispCon_setDispSendEvent(o, dispSendEvFp)
Install the send-ready callback before enabling events.
Definition: SoDispCon.h:406
BA_API void SoDispCon_setTCPNoDelay(SoDispCon *o, int enable)
Disable the TCP delay.
#define SoDispCon_readData(o, data, len, relmutex)
Read through the installed transport using its recorded readiness.
Definition: SoDispCon.h:417
BA_API int SoDispCon_sendDataNT(SoDispCon *o, const void *data, int len)
Send all bytes with the sendData contract, but omit body tracing.
BA_API int SoDispCon_sendData(SoDispCon *o, const void *data, int len)
Send an entire buffer through the installed transport.
#define SoDispCon_recEvActive(o)
Definition: SoDispCon.h:360
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.
BA_API BaBool SoDispCon_cmpAddr(SoDispCon *o, HttpSockaddr *addr2)
Compare an address with the current peer address, ignoring port numbers.
BA_API int SoDispCon_asyncConnectNext(SoDispCon *o)
Try the next resolved address after a failed pending connection.
#define SoDispCon_isIP6(o)
Definition: SoDispCon.h:373
void(* SoDispCon_DispSendEv)(struct SoDispCon *con)
Dispatcher send-ready notification, invoked with its mutex held.
Definition: SoDispCon.h:112
void(* SoDispCon_DispRecEv)(struct SoDispCon *con)
Dispatcher receive notification, invoked with its mutex held.
Definition: SoDispCon.h:108
BA_API int SoDispCon_moveCon(SoDispCon *o, SoDispCon *newCon)
Move socket and transport ownership without copying object storage.
BA_API void * SoDispCon_allocAsynchBuf(SoDispCon *o, int *size)
Obtain transport-owned writable storage for asynchronous sending.
BA_API void SoDispCon_constructor(SoDispCon *o, struct SoDisp *dispatcher, SoDispCon_DispRecEv e)
Initialize an empty connection without opening a socket.
#define SoDispCon_hasMoreData(o)
Definition: SoDispCon.h:352
#define SoDispCon_dispatcherHasCon(o)
Definition: SoDispCon.h:356
#define SoDispCon_isSecure(o)
Test a successfully installed transport for TLS.
Definition: SoDispCon.h:384
#define SoDispCon_isValid(o)
Definition: SoDispCon.h:396
BA_API int SoDispCon_getSockName(SoDispCon *o, HttpSockaddr *addr, U16 *port)
Read the local socket endpoint.
BA_API char * SoDispCon_addr2String(SoDispCon *o, HttpSockaddr *addr, char *buf, int len)
Format a numeric address without a port number.
#define SoDispCon_sendEvActive(o)
Definition: SoDispCon.h:364
#define SoDispCon_getSharkSslCon(o, sharkSslConPtrPtr)
Inspect a successfully installed transport.
Definition: SoDispCon.h:392
BA_API int SoDispCon_sendChunkData(SoDispCon *o, const void *data, int len)
Send one HTTP chunk, including its hexadecimal size and CRLF delimiters.
BA_API int SoDispCon_getSharkAlert(SoDispCon *o, U8 *alertLevel, U8 *alertDescription)
Read the current SharkSSL alert fields.
struct SoDispCon SoDispCon
Contains information about the physical socket connection.
BA_API int SoDispCon_asyncReadyF(SoDispCon *o)
Advance asynchronous sending; same status contract as SoDispCon_asyncReady.
BA_API int SoDispCon_getPeerName(SoDispCon *o, HttpSockaddr *addr, U16 *port)
Read the remote peer endpoint.
#define SoDispCon_getDispatcher(o)
Definition: SoDispCon.h:400
BA_API int SoDispCon_setNonblocking(SoDispCon *o)
Select nonblocking socket mode.
uint16_t U16
Unsigned 16-bit integer.
Definition: GenPrimT.h:91
uint32_t U32
Unsigned 32-bit integer.
Definition: GenPrimT.h:93
uint8_t U8
Unsigned 8-bit integer.
Definition: GenPrimT.h:89
U8 BaBool
Boolean stored in an unsigned byte; FALSE is zero and TRUE is one.
Definition: GenPrimT.h:118
Memory allocation and deallocation Interface class.
Definition: AllocatorIntf.h:98
Contains information about the physical socket connection.
Definition: SoDispCon.h:120
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.
Definition: SoDispCon.h:680
int setBlocking()
Select blocking socket mode.
Definition: SoDispCon.h:634
struct SoDisp * getDispatcher()
Definition: SoDispCon.h:664
int asyncSend(int len)
Begin or advance a send from the transport's asynchronous buffer.
Definition: SoDispCon.h:672
SoDispCon()
Uninitialized storage; call SoDispCon_constructor before use.
Definition: SoDispCon.h:125
bool isIP6()
Definition: SoDispCon.h:640
bool isValid()
Definition: SoDispCon.h:642
bool isSecure()
Deprecated: Use getSharkSslCon(NULL).
Definition: SoDispCon.h:636
int sendChunkData(const void *data, int len)
Send one HTTP chunk, including its hexadecimal size and CRLF delimiters.
Definition: SoDispCon.h:674
bool sendEvActive()
Definition: SoDispCon.h:662
void setDispRecEvent(SoDispCon_DispRecEv ev)
Install a receive callback before enabling receive events.
Definition: SoDispCon.h:668
char * addr2String(HttpSockaddr *addr, char *buf, int len)
Format a numeric address without a port number.
Definition: SoDispCon.h:648
bool cmpAddr(HttpSockaddr *addr2)
Compare an address with the current peer address, ignoring port numbers.
Definition: SoDispCon.h:650
bool getSharkSslCon(SharkSslCon **sc)
Inspect a connected transport's TLS implementation.
Definition: SoDispCon.h:638
void setTCPNoDelay(bool enable)
Disable the TCP delay.
Definition: SoDispCon.h:653
bool hasMoreData()
Definition: SoDispCon.h:655
void * allocAsynchBuf(int *size)
Obtain transport-owned writable storage for asynchronous sending.
Definition: SoDispCon.h:678
int asyncReady()
Advance pending output and inspect completion.
Definition: SoDispCon.h:676
int readData(void *data, int len, bool relmutex=false)
Read through the installed transport using its recorded readiness.
Definition: SoDispCon.h:630
bool recEvActive()
Definition: SoDispCon.h:660
int sendData(const void *data, int len)
Send an entire buffer through the installed transport.
Definition: SoDispCon.h:670
int getSockName(HttpSockaddr *addr, U16 *port=0)
Read the local socket endpoint.
Definition: SoDispCon.h:646
void setDispSendEvent(SoDispCon_DispSendEv ev)
Install a send-ready callback before enabling send events.
Definition: SoDispCon.h:666
int setNonblocking()
Select nonblocking socket mode.
Definition: SoDispCon.h:632
bool dispatcherHasCon()
Definition: SoDispCon.h:658
int getPeerName(HttpSockaddr *addr, U16 *port=0)
Read the remote peer endpoint.
Definition: SoDispCon.h:644
The SoDisp dispatches any socket connection that contains data by calling the SoDispCon::execute memb...
Definition: SoDisp.h:91
A mutual exclusion class.
Definition: ThreadLib.h:196