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

Detailed Description

Create a SharkSSL server listen object.

The object binds itself to the SoDisp object and makes the web-server listen for new connections on the port specified. The default port is 443. You can create several of these objects and bind to the dispatcher if you want the web-server to listen to more than one port.

#include <HttpSharkSslServCon.h>

Public Member Functions

 HttpSharkSslServCon ()
 Uninitialized storage; use a C constructor before use or destruction. More...
 
 HttpSharkSslServCon (SharkSsl *sharkSsl, HttpServer *server, SoDisp *dispatcher, U16 port=443, bool setIP6=false, const void *interfaceName=0, HttpServCon_AcceptNewCon userDefinedAccept=0)
 Create a SharkSSL Server Connection. More...
 
BaBool isValid ()
 
int setPort (U16 portNumber, bool setIp6=false, const void *interfaceName=0)
 Open a replacement listener, then close the old listener on success. More...
 
 ~HttpSharkSslServCon ()
 Close the listener and every accepted TLS connection still tracked by it. More...
 

Constructor & Destructor Documentation

◆ HttpSharkSslServCon() [1/2]

HttpSharkSslServCon::HttpSharkSslServCon ( )

Uninitialized storage; use a C constructor before use or destruction.

◆ HttpSharkSslServCon() [2/2]

HttpSharkSslServCon::HttpSharkSslServCon ( SharkSsl *  sharkSsl,
HttpServer *  server,
SoDisp *  dispatcher,
U16  port = 443,
bool  setIP6 = false,
const void *  interfaceName = 0,
HttpServCon_AcceptNewCon  userDefinedAccept = 0 
)

Create a SharkSSL Server Connection.

Parameters
sharkSslis the SharkSsl instance required for operating the server connection. You must make sure that this object is valid for the lifetime of the listener and its accepted connections. It must have role SharkSsl_Server and be configured before listening. An incorrect role violates the constructor precondition.
serverRequired borrowed server, valid throughout listener use.
dispatcherRequired borrowed dispatcher, valid throughout use.
portTCP listen port in host byte order, normally 443. Zero initializes an inactive listener without opening a socket.
setIP6TRUE selects IPv6, FALSE IPv4. This parameter is ignored unless the underlying TCP/IP stack is a dual IP V4 and IP V6 stack.
interfaceNameBorrowed platform binding address/interface, used during the call; normally a NUL-terminated address string. NULL binds the wildcard address. Accepted representation is platform-specific.
userDefinedAcceptSame functionality as for HttpServCon, but this callback is for implementing secure servers. The temporary-connection ownership rules of HttpServCon_AcceptNewCon apply. The callback may run before the TLS handshake completes. It is required in NO_BA_SERVER builds; otherwise NULL selects HTTP handling.

◆ ~HttpSharkSslServCon()

HttpSharkSslServCon::~HttpSharkSslServCon ( )

Close the listener and every accepted TLS connection still tracked by it.

Does not destroy the borrowed TLS configuration, server or dispatcher.

Member Function Documentation

◆ isValid()

BaBool HttpSharkSslServCon::isValid ( )
Returns
TRUE when the listening socket is valid, FALSE otherwise. Check after construction, which returns no status.

◆ setPort()

int HttpSharkSslServCon::setPort ( U16  portNumber,
bool  setIp6 = false,
const void *  interfaceName = 0 
)

Open a replacement listener, then close the old listener on success.

Parameters
[in]portNumberNew TCP port in host byte order, 1..65535.
[in]setIp6True selects IPv6, false IPv4 (default).
[in]interfaceNameBorrowed platform binding address/interface, or NULL for wildcard; used during this call only.
Returns
Zero on success, -1 on failure. The old listener is retained if replacement setup fails. Uses the associated server's dispatcher. Hold the dispatcher mutex during this operation.