Interface that provides the methods available on a single TCP connection.
More...
#include <Network.h>
Interface that provides the methods available on a single TCP connection.
Definition at line 41 of file Network.h.
◆ cCallbacksPtr
◆ ~cTCPLink()
virtual cTCPLink::~cTCPLink |
( |
| ) |
|
|
inlinevirtual |
◆ cTCPLink()
Creates a new link, with the specified callbacks.
Definition at line 143 of file Network.h.
◆ Close()
virtual void cTCPLink::Close |
( |
void |
| ) |
|
|
pure virtual |
Drops the connection without any more processing.
Sends the RST packet, queued outgoing and incoming data is lost.
Implemented in cTCPLinkImpl.
◆ GetCallbacks()
Returns the callbacks that are used.
Definition at line 135 of file Network.h.
◆ GetLocalIP()
virtual AString cTCPLink::GetLocalIP |
( |
void |
| ) |
const |
|
pure virtual |
Returns the IP address of the local endpoint of the connection.
Implemented in cTCPLinkImpl.
◆ GetLocalPort()
virtual UInt16 cTCPLink::GetLocalPort |
( |
void |
| ) |
const |
|
pure virtual |
Returns the port used by the local endpoint of the connection.
Implemented in cTCPLinkImpl.
◆ GetRemoteIP()
virtual AString cTCPLink::GetRemoteIP |
( |
void |
| ) |
const |
|
pure virtual |
Returns the IP address of the remote endpoint of the connection.
Implemented in cTCPLinkImpl.
◆ GetRemotePort()
virtual UInt16 cTCPLink::GetRemotePort |
( |
void |
| ) |
const |
|
pure virtual |
Returns the port used by the remote endpoint of the connection.
Implemented in cTCPLinkImpl.
◆ Send() [1/2]
bool cTCPLink::Send |
( |
const AString & |
a_Data | ) |
|
|
inline |
Queues the specified data for sending to the remote peer.
Returns true on success, false on failure. Note that this success or failure only reports the queue status, not the actual data delivery.
Definition at line 83 of file Network.h.
◆ Send() [2/2]
virtual bool cTCPLink::Send |
( |
const void * |
a_Data, |
|
|
size_t |
a_Length |
|
) |
| |
|
pure virtual |
Queues the specified data for sending to the remote peer.
Returns true on success, false on failure. Note that this success or failure only reports the queue status, not the actual data delivery.
Implemented in cTCPLinkImpl.
◆ Shutdown()
virtual void cTCPLink::Shutdown |
( |
void |
| ) |
|
|
pure virtual |
Closes the link gracefully.
The link will send any queued outgoing data, then it will send the FIN packet. The link will still receive incoming data from remote until the remote closes the connection.
Implemented in cTCPLinkImpl.
◆ StartTLSClient()
Starts a TLS handshake as a client connection.
If a client certificate should be used for the connection, set the certificate into a_OwnCertData and its corresponding private key to a_OwnPrivKeyData. If both are empty, no client cert is presented. a_OwnPrivKeyPassword is the password to be used for decoding PrivKey, empty if not passworded. Returns empty string on success, non-empty error description on failure.
Implemented in cTCPLinkImpl.
◆ StartTLSServer()
Starts a TLS handshake as a server connection.
Set the server certificate into a_CertData and its corresponding private key to a_OwnPrivKeyData. a_OwnPrivKeyPassword is the password to be used for decoding PrivKey, empty if not passworded. a_StartTLSData is any data that should be pushed into the TLS before reading more data from the remote. This is used mainly for protocols starting TLS in the middle of communication, when the TLS start command can be received together with the TLS Client Hello message in one OnReceivedData() call, to re-queue the Client Hello message into the TLS handshake buffer. Returns empty string on success, non-empty error description on failure.
Implemented in cTCPLinkImpl.
◆ cNetwork
◆ m_Callbacks
Callbacks to be used for the various situations.
Definition at line 139 of file Network.h.
The documentation for this class was generated from the following file: