![]() |
VR-Link API Documentation for HLA 4
|
Inheritance diagram for DtInetTlsSocket:
Collaboration diagram for DtInetTlsSocket:Public Member Functions | |
| DtInetTlsSocket () | |
| DtInetTlsSocket (DtU16 localPort, DtInetDevice *hostIf=nullptr, DtInetUtils::DtInetAddrFamily family=DtInetUtils::DtInetAddrFamily_IPv4, DtU32 flags=DtSockOptNoDelay, bool immediateOpen=true) | |
| Server Socket Constructor. More... | |
| DtInetTlsSocket (const DtInetEndpoint &dest, DtU16 localPort=0, DtInetDevice *hostIf=nullptr, DtU32 flags=DtDefaultSockOpts, bool immediateOpen=true) | |
| Interactive Socket Constructors. More... | |
| virtual | ~DtInetTlsSocket () |
| virtual bool | handshakeDestination () |
| Perform SSL handshake after TCP connection is established. More... | |
| virtual bool | setSocket (const DtInetEndpoint &dest, DtU16 localPort=0, DtInetDevice *hostIf=nullptr, DtU32 flags=DtDefaultSockOpts) override |
| Use TCP base for destination, binding, and options. More... | |
| virtual bool | setDestination (const DtInetEndpoint &addr) override |
| Use TCP base for destination, binding, and options. More... | |
| virtual bool | openSocket () override |
| Use TCP base for destination, binding, and options. More... | |
| virtual bool | closeSocket () override |
| Use TCP base for destination, binding, and options. More... | |
| virtual bool | listenForConnections () override |
| Use TCP base for destination, binding, and options. More... | |
| virtual bool | acceptConnection (DtInetTcpSocket *peer, DtU32 flags=DtDefaultSockOpts) override |
| Use TCP base for destination, binding, and options. More... | |
| virtual int | send (caddr_t packet, size_t size, DtU32 flags=0) override |
| Use TCP base for destination, binding, and options. More... | |
| virtual int | sendTo (caddr_t packet, size_t size, DtInetEndpoint &dest, DtU32 flags=0) override |
| Use TCP base for destination, binding, and options. More... | |
| virtual int | sendChain (DtInetBufferChain &packets, DtU32 flags=0) override |
| Use TCP base for destination, binding, and options. More... | |
| virtual int | sendChainTo (DtInetBufferChain &packets, DtInetEndpoint &dest, DtU32 flags=0) override |
| Use TCP base for destination, binding, and options. More... | |
| virtual DtInetSockRcvStatus | recv (caddr_t buff, size_t buffSize, DtU32 flags=0) override |
| Use TCP base for destination, binding, and options. More... | |
| virtual DtInetSockRcvStatus | recvToChain (DtInetBufferChain &packets, DtU32 flags=0) override |
| Use TCP base for destination, binding, and options. More... | |
| virtual DtInetSockRcvStatus | recvFrom (caddr_t buff, size_t buffSize, DtInetEndpoint &src, DtU32 flags=0) override |
| Use TCP base for destination, binding, and options. More... | |
| virtual DtInetSockRcvStatus | recvToChainFrom (DtInetBufferChain &packets, DtInetEndpoint &src, DtU32 flags=0) override |
| Use TCP base for destination, binding, and options. More... | |
| virtual unsigned | descriptor () const override |
| Use TCP base for destination, binding, and options. More... | |
Public Member Functions inherited from DtInetTcpSocket | |
| DtInetTcpSocket (DtInetProtocol protocolToUse=DtInetProtocol_TCP) | |
| Default Constructor. More... | |
| DtInetTcpSocket (DtU16 localPort, DtInetDevice *hostIf=nullptr, DtInetUtils::DtInetAddrFamily family=DtInetUtils::DtInetAddrFamily_IPv4, DtU32 flags=DtSockOptNoDelay, bool immediateOpen=true, DtInetProtocol protocolToUse=DtInetProtocol_TCP) | |
| Server Socket Constructor. More... | |
| DtInetTcpSocket (const DtInetEndpoint &dest, DtU16 localPort=0, DtInetDevice *hostIf=nullptr, DtU32 flags=DtDefaultSockOpts, bool immediateOpen=true) | |
| Interactive Socket Constructors. More... | |
| virtual | ~DtInetTcpSocket () |
| Destructor. More... | |
| virtual bool | bindToDevice (const DtInetDevice *hostIf=nullptr) override |
| Set the network interface device the socket will attempt to bind to on the local host. More... | |
| virtual bool | connectToDestination () override |
| Initiate a connection to the destination endpoint. More... | |
| virtual bool | isOk () override |
| Deprecated. More... | |
| virtual bool | setNonBlockingOption (bool onOrOff) |
| virtual bool | setReuseAddressOption (bool onOrOff) |
| virtual bool | setSendBufferSize (DtU32 size) |
| virtual bool | setReceiveBufferSize (DtU32 size) |
| virtual bool | setDoNotRouteOption (bool onOrOff) |
| virtual bool | setSendLowWatermark (DtU32 size) |
| virtual bool | setReceiveLowWatermark (DtU32 size) |
| virtual bool | setTcpNoDelayOption (bool onOrOff) |
| virtual bool | setTcpLingerOption (DtU16 timeout) |
| virtual bool | setConnAbortedOption (bool onOrOff) |
| virtual bool | setTcpKeepAliveOption (bool onOrOff) |
| virtual DtU32 | getSendBufferSize () |
| virtual DtU32 | getReceiveBufferSize () |
| virtual DtU32 | getBytesAvailable () |
| virtual bool | getReuseAddressOption () |
| virtual bool | getDoNotRouteOption () |
| virtual DtU32 | getSendLowWatermark () |
| virtual DtU32 | getReceiveLowWatermark () |
| virtual bool | getTcpLingerOption (DtU16 &timeout) |
| virtual bool | getConnAbortedOption () |
| virtual bool | getTcpKeepAliveOption () |
Public Member Functions inherited from DtInetSocket | |
| DtInetSocket () | |
| Default Constructor. More... | |
| virtual | ~DtInetSocket () |
| Destructor. More... | |
| virtual const DtInetEndpoint & | destination () const |
| virtual const DtInetEndpoint & | localEndpoint () const |
| Get the local endpoint for the socket. More... | |
| virtual bool | setLocalPort (DtU16 port) |
| Set / get the local port number of the socket. More... | |
| virtual DtU16 | localPort () const |
| virtual const DtInetDevice * | hostIf () const |
| Get the host network interface device the socket is bound to. More... | |
| virtual DtInetSockState | state () |
| Return the present state of the socket. More... | |
| virtual DtU32 | protocol () const |
| Get the protocol (DtInetProtocol_TCP or DtInetProtocol_UDP) More... | |
| virtual DtInetUtils::DtInetAddrFamily | family () const |
| Get the address family, IPv4 or IPv6. More... | |
| virtual DtU32 | flags () |
| Get the flags for this socket. More... | |
| virtual DtU64 | totalBytesSent () const |
| Get traffic statistics. More... | |
| virtual DtU64 | totalPacketsSent () const |
| virtual DtU64 | totalBytesReceived () const |
| virtual DtU64 | totalPacketsReceived () const |
| virtual void | clearStats () |
| Reset all statistics. More... | |
| virtual bool | addProcessingCallback (DtInetSockProcessingType kind, DtInetSocketProcessingCallback cb, void *usr, int callSequence=-1) |
| Add / remove pre- and post- processing callbacks. More... | |
| virtual bool | removeProcessingCallback (DtInetSockProcessingType kind, DtInetSocketProcessingCallback cb) |
| virtual DtTime | receiveTime () |
| virtual bool | isNonBlocking () const |
| virtual bool | isNoDelay () const |
| virtual bool | isIPv4 () const |
| Return true if the socket matches the queried family or protocol. More... | |
| virtual bool | isIPv6 () const |
| Return true if the socket matches the queried family or protocol. More... | |
| virtual bool | isTcp () const |
| Return true if the socket matches the queried family or protocol. More... | |
| virtual bool | isTls () const |
| Return true if the socket matches the queried family or protocol. More... | |
| virtual bool | isUdp () const |
| Return true if the socket matches the queried family or protocol. More... | |
| virtual int | getLastError () const |
| Return code or string describing last error. More... | |
| virtual const DtString & | getLastErrorString () const |
| Return code or string describing last error. More... | |
| virtual bool | isErrorWouldBlockOrTryAgain () const |
| Return code or string describing last error. More... | |
| virtual void | clearError () |
| Return code or string describing last error. More... | |
| virtual int | getTerminationCode () const |
| Return code or string describing termination cause. More... | |
| virtual const DtString & | getTerminationString () const |
| Return code or string describing termination cause. More... | |
Static Public Member Functions | |
| static void | setServerCRT (const DtString &crt) |
| static const DtString & | serverCRT () |
| static void | setServerKey (const DtString &key) |
| static const DtString & | serverKey () |
| static void | setClientCRT (const DtString &crt) |
| static const DtString & | clientCRT () |
| static void | setClientKey (const DtString &key) |
| static const DtString & | clientKey () |
| static void | setCaCRT (const DtString &crt) |
| static const DtString & | caCRT () |
| static void | setCertificateFolder (const DtString &folder) |
| static const DtString & | certificateFolder () |
| static void | setClientCertRequired (bool required) |
| static bool | clientCertRequired () |
Protected Member Functions | |
| virtual bool | initSslForListening () |
| Initialize SSL context for server/listening sockets. Returns true on success. More... | |
| virtual bool | initClientSslContext () |
| virtual bool | buildCertificateFilePath (DtFilename &certFilename) |
| Build the file path for the certificate file, prepending the certificate folder if the file name is relative. More... | |
Protected Member Functions inherited from DtInetTcpSocket | |
| virtual bool | initAcceptedConnection (const DtInetEndpoint &localEndpoint, DtU32 flags=DtDefaultSockOpts) |
| Accepted Connection Initializer. More... | |
| virtual bool | openAcceptedConnection (const DtInetEndpoint &peer) |
| Accepted Connection finalizer. More... | |
| virtual bool | openSocket (DtInetProtocol protocolToUse) |
| Used by this class and derivations to open socket with specified protocol (e.g., TCP or TLS) More... | |
| virtual void * | tcpSocket () |
| Return the underlying socket object. Must be cast to appropriate type before using. More... | |
| virtual void * | tcpServerSocket () |
| bool | isServerSock () const |
| Return true if the socket is a listening (aka 'server') socket. More... | |
Protected Member Functions inherited from DtInetSocket | |
| virtual bool | findAndRemoveCallback (DtInetSockCallbackList &cbList, DtInetSocketProcessingCallback cb) |
Static Protected Attributes | |
| static bool | theClientCertRequired |
| Wheter server sockets require client certificates for mutual authentication. Default is true. More... | |
| static DtString | theServerCRT |
| Static members for default certificate paths and client cert requirement. More... | |
| static DtString | theServerKey |
| Static members for default certificate paths and client cert requirement. More... | |
| static DtString | theClientCRT |
| Static members for default certificate paths and client cert requirement. More... | |
| static DtString | theClientKey |
| Static members for default certificate paths and client cert requirement. More... | |
| static DtString | theCaCRT |
| Static members for default certificate paths and client cert requirement. More... | |
| static DtString | theCertificateFolder |
| Folder to prepend to certificate file names if the file name is relative. More... | |
| DtInetTlsSocket::DtInetTlsSocket | ( | ) |
| DtInetTlsSocket::DtInetTlsSocket | ( | DtU16 | localPort, |
| DtInetDevice * | hostIf = nullptr, |
||
| DtInetUtils::DtInetAddrFamily | family = DtInetUtils::DtInetAddrFamily_IPv4, |
||
| DtU32 | flags = DtSockOptNoDelay, |
||
| bool | immediateOpen = true |
||
| ) |
Server Socket Constructor.
Takes a port number to listen on, a pointer to the local network interface device the socket will be bound to, an address family indication (IPv4 or IPv6), socket option flags, and a trigger to open the socket immediately. If no host interface is specified the socket will be bound to INADDR_ANY (or IN6ADDR_ANY). If the 'immediateOpen' parameter is true the socket will immediately try to bind to an interface and listen for inbound connection attempts. New connections will not be automatically accepted if no socket addition callbacks are registered, therefore all new connections must be accepted by calling the acceptConnection() method. If the 'immediateOpen' parameter is false the socket will not start listening for connection attempts until the listenForConnections() method is invoked. Socket addition callbacks should be registered prior to invoking listen(). This ctor will not throw exceptions on failure. Check the socket status by calling state() (or isOk()) to determine if the socket is ready to use.
| DtInetTlsSocket::DtInetTlsSocket | ( | const DtInetEndpoint & | dest, |
| DtU16 | localPort = 0, |
||
| DtInetDevice * | hostIf = nullptr, |
||
| DtU32 | flags = DtDefaultSockOpts, |
||
| bool | immediateOpen = true |
||
| ) |
Interactive Socket Constructors.
Takes a DtInetEndpoint (containing the destination address, protocol - TCP or UDP, and destination port number), a source port number to use, a pointer to the local network interface device the socket will be bound to, socket option flags, and an 'immediateOpen' indicator dictating how the socket should behave upon creation. The address family (IPv4 or IPv6) is assumed from the destin- ation endpoint object. If the specified local port is 0 an ephemeral port will be chosen for the connection UNLESS the destination is a broadcast or multicast address, in which case the destination port is used as the local port also. If no host interface is specified the most appropriate interface will be chosen based on the destination. If the destination endpoint specifies a multicast address the multicast group is joined automatically when the socket is opened and the group member- ship is dropped when the socket is closed. If the 'immediateOpen' parameter is true the socket will immediately try to bind to an interface and connect to the destination (TCP sockets) or allow datagrams to be sent and received (UDP) using the default packet handlers which perform no parsing of packets. To use custom packet handlers for TCP send and receive functions set 'immediateOpen' to false when using this ctor, then configure the packet handler callbacks, then call connectToDestination(). To use custom packet handlers for UDP send and receive functions set 'immediateOpen' to false, configure the packet handler callbacks, then call openSocket() or connectToDestination() if the UDP socket will only communicate with a single remote host. This ctor will not throw exceptions on failure. Check the socket status by calling state() (or isOk()) to determine if the socket is ready.
|
virtual |
|
overridevirtual |
Use TCP base for destination, binding, and options.
Reimplemented from DtInetTcpSocket.
|
protectedvirtual |
Build the file path for the certificate file, prepending the certificate folder if the file name is relative.
Checks if the resulting file path exists and is readable. Returns true on success; otherwise, false.
|
static |
|
static |
|
static |
|
static |
|
static |
|
overridevirtual |
Use TCP base for destination, binding, and options.
Reimplemented from DtInetTcpSocket.
|
overridevirtual |
Use TCP base for destination, binding, and options.
Reimplemented from DtInetTcpSocket.
|
virtual |
Perform SSL handshake after TCP connection is established.
Returns true on successful handshake; otherwise, false.
|
protectedvirtual |
|
protectedvirtual |
Initialize SSL context for server/listening sockets. Returns true on success.
|
overridevirtual |
Use TCP base for destination, binding, and options.
Reimplemented from DtInetTcpSocket.
|
overridevirtual |
Use TCP base for destination, binding, and options.
Reimplemented from DtInetTcpSocket.
|
overridevirtual |
Use TCP base for destination, binding, and options.
Reimplemented from DtInetTcpSocket.
|
overridevirtual |
Use TCP base for destination, binding, and options.
Reimplemented from DtInetTcpSocket.
|
overridevirtual |
Use TCP base for destination, binding, and options.
Reimplemented from DtInetTcpSocket.
|
overridevirtual |
Use TCP base for destination, binding, and options.
Reimplemented from DtInetTcpSocket.
Use TCP base for destination, binding, and options.
Reimplemented from DtInetTcpSocket.
|
overridevirtual |
Use TCP base for destination, binding, and options.
Reimplemented from DtInetTcpSocket.
|
overridevirtual |
Use TCP base for destination, binding, and options.
Reimplemented from DtInetTcpSocket.
|
overridevirtual |
Use TCP base for destination, binding, and options.
Reimplemented from DtInetTcpSocket.
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
overridevirtual |
Use TCP base for destination, binding, and options.
Reimplemented from DtInetTcpSocket.
|
static |
|
static |
|
overridevirtual |
Use TCP base for destination, binding, and options.
Reimplemented from DtInetTcpSocket.
|
protected |
Track whether we own the SSL context (i.e., should delete it in destructor) Accepted client sockets will share the SSL context of the listening socket, so they do not own the context and should not delete it.
|
protected |
opaque handles to avoid exposing boost types in header
|
protected |
opaque handles to avoid exposing boost types in header
|
protected |
Track whether the SSL stream is currently open (i.e., handshake completed).
This is needed to determine whether we can send/receive data and to prevent certain operations like changing the destination or closing the socket while the stream is open.
|
staticprotected |
Static members for default certificate paths and client cert requirement.
These can be set by the application before creating any TLS sockets to specify the default certificates to use for server and client sockets, and whether client certs are required by default for server sockets.
|
staticprotected |
Folder to prepend to certificate file names if the file name is relative.
If the file name is absolute or the folder is empty, the file name is used as-is. Default is empty, which means certs must be in the working directory or reset with appropriate paths.
|
staticprotected |
Wheter server sockets require client certificates for mutual authentication. Default is true.
|
staticprotected |
Static members for default certificate paths and client cert requirement.
These can be set by the application before creating any TLS sockets to specify the default certificates to use for server and client sockets, and whether client certs are required by default for server sockets.
|
staticprotected |
Static members for default certificate paths and client cert requirement.
These can be set by the application before creating any TLS sockets to specify the default certificates to use for server and client sockets, and whether client certs are required by default for server sockets.
|
staticprotected |
Static members for default certificate paths and client cert requirement.
These can be set by the application before creating any TLS sockets to specify the default certificates to use for server and client sockets, and whether client certs are required by default for server sockets.
|
staticprotected |
Static members for default certificate paths and client cert requirement.
These can be set by the application before creating any TLS sockets to specify the default certificates to use for server and client sockets, and whether client certs are required by default for server sockets.