12 #include "../OSSupport/Network.h" 72 const AString & a_OwnPrivKeyData,
73 const AString & a_OwnPrivKeyPassword
86 const AString & a_OwnPrivKeyData,
87 const AString & a_OwnPrivKeyPassword,
113 virtual void OnError(
int a_ErrorCode,
const AString & a_ErrorMsg)
override;
117 virtual void OnReceivedData(
const char * a_Data,
size_t a_Length)
override;
virtual void OnReceivedData(const char *a_Data, size_t a_Length) override
Called when there's data incoming from the remote peer.
std::unique_ptr< cTableRef > cTableRefPtr
AString StartTLSServer(const AString &a_OwnCertData, const AString &a_OwnPrivKeyData, const AString &a_OwnPrivKeyPassword, const AString &a_StartTLSData)
Starts a TLS handshake as a server connection.
AString GetRemoteIP(void) const
Returns the IP address of the remote endpoint of the connection.
void Terminated(void)
Common code called when the link is considered as terminated.
bool Send(const AString &a_Data)
Sends the data contained in the string to the remote peer.
UInt16 GetLocalPort(void) const
Returns the port used by the local endpoint of the connection.
void Shutdown(void)
Closes the link gracefully.
cLuaServerHandleWPtr m_Server
The server that is responsible for this link, if any.
void ReceivedCleartextData(const char *a_Data, size_t a_NumBytes)
Called by the SSL context when there's incoming data available in the cleartext.
std::shared_ptr< cTCPLink > cTCPLinkPtr
virtual ~cLuaTCPLink() override
cTCPLinkPtr m_Link
The underlying link representing the connection.
cLuaTCPLink(cLuaState::cTableRefPtr &&a_Callbacks)
Creates a new instance of the link, wrapping the callbacks that are in the specified table...
std::weak_ptr< cLuaServerHandle > cLuaServerHandleWPtr
void Close(void)
Drops the connection without any more processing.
virtual void OnLinkCreated(cTCPLinkPtr a_Link) override
Called when the cTCPLink for the connection is created.
virtual void OnError(int a_ErrorCode, const AString &a_ErrorMsg) override
Called when an error is detected on the connection.
Interface that provides the methods available on a single TCP connection.
UInt16 GetRemotePort(void) const
Returns the port used by the remote endpoint of the connection.
Callbacks used for connecting to other servers as a client.
AString StartTLSClient(const AString &a_OwnCertData, const AString &a_OwnPrivKeyData, const AString &a_OwnPrivKeyPassword)
Starts a TLS handshake as a client connection.
AString GetLocalIP(void) const
Returns the IP address of the local endpoint of the connection.
cLuaState::cTableRefPtr m_Callbacks
The Lua table that holds the callbacks to be invoked.
virtual void OnRemoteClosed(void) override
Called when the remote end closes the connection.
virtual void OnConnected(cTCPLink &a_Link) override
Called when the Connect call succeeds.