#include <TcpClient.h>
|
| TcpClient (bool autoDestruct) |
|
| TcpClient (tcp_pcb *clientTcp, TcpClientDataDelegate clientReceive, TcpClientCompleteDelegate onCompleted) |
|
| TcpClient (TcpClientCompleteDelegate onCompleted, TcpClientEventDelegate onReadyToSend, TcpClientDataDelegate onReceive=nullptr) |
|
| TcpClient (TcpClientCompleteDelegate onCompleted, TcpClientDataDelegate onReceive=nullptr) |
|
| TcpClient (TcpClientDataDelegate onReceive) |
|
| ~TcpClient () |
|
bool | connect (const String &server, int port, bool useSsl=false) override |
|
bool | connect (IpAddress addr, uint16_t port, bool useSsl=false) override |
|
void | close () override |
|
void | setReceiveDelegate (TcpClientDataDelegate receiveCb=nullptr) |
| Set or clear the callback for received data. More...
|
|
void | setCompleteDelegate (TcpClientCompleteDelegate completeCb=nullptr) |
| Set or clear the callback for connection close. More...
|
|
bool | send (const char *data, uint16_t len, bool forceCloseAfterSent=false) |
|
bool | sendString (const String &data, bool forceCloseAfterSent=false) |
|
bool | isProcessing () |
|
TcpClientState | getConnectionState () |
|
void | setCloseAfterSent (bool ignoreIncomingData=false) |
|
int | writeString (const char *data, uint8_t apiflags=TCP_WRITE_FLAG_COPY) |
|
int | writeString (const String &data, uint8_t apiflags=TCP_WRITE_FLAG_COPY) |
|
virtual int | write (const char *data, int len, uint8_t apiflags=TCP_WRITE_FLAG_COPY) |
| Base write operation. More...
|
|
int | write (IDataSourceStream *stream) |
|
uint16_t | getAvailableWriteSize () |
|
void | flush () |
|
void | setTimeOut (uint16_t waitTimeOut) |
|
IpAddress | getRemoteIp () const |
|
uint16_t | getRemotePort () const |
|
void | setDestroyedDelegate (TcpConnectionDestroyedDelegate destroyedDelegate) |
| Sets a callback to be called when the object instance is destroyed. More...
|
|
void | setSslInitHandler (Ssl::Session::InitDelegate handler) |
| Set the SSL session initialisation callback. More...
|
|
bool | setSslConnection (Ssl::Connection *connection) |
|
Ssl::Session * | getSsl () |
| Get a pointer to the current SSL session object. More...
|
|
◆ TcpClient() [1/5]
TcpClient::TcpClient |
( |
bool |
autoDestruct | ) |
|
|
inline |
◆ TcpClient() [2/5]
◆ TcpClient() [3/5]
◆ TcpClient() [4/5]
◆ TcpClient() [5/5]
◆ ~TcpClient()
TcpClient::~TcpClient |
( |
| ) |
|
|
inline |
◆ close()
void TcpClient::close |
( |
| ) |
|
|
overridevirtual |
◆ connect() [1/2]
◆ connect() [2/2]
◆ flush()
void TcpConnection::flush |
( |
| ) |
|
|
inherited |
◆ freeStreams()
void TcpClient::freeStreams |
( |
| ) |
|
|
protected |
◆ getAvailableWriteSize()
uint16_t TcpConnection::getAvailableWriteSize |
( |
| ) |
|
|
inlineinherited |
◆ getConnectionState()
◆ getRemoteIp()
IpAddress TcpConnection::getRemoteIp |
( |
| ) |
const |
|
inlineinherited |
◆ getRemotePort()
uint16_t TcpConnection::getRemotePort |
( |
| ) |
const |
|
inlineinherited |
◆ getSsl()
Get a pointer to the current SSL session object.
Note that this is typically used so we can query properties of an established session. If you need to change session parameters this must be done via setSslInitHandler
.
◆ initialize()
void TcpConnection::initialize |
( |
tcp_pcb * |
pcb | ) |
|
|
protectedinherited |
◆ internalConnect()
◆ internalOnConnected()
err_t TcpConnection::internalOnConnected |
( |
err_t |
err | ) |
|
|
protectedinherited |
◆ internalOnDnsResponse()
void TcpConnection::internalOnDnsResponse |
( |
const char * |
name, |
|
|
LWIP_IP_ADDR_T * |
ipaddr, |
|
|
int |
port |
|
) |
| |
|
protectedinherited |
◆ internalOnError()
void TcpConnection::internalOnError |
( |
err_t |
err | ) |
|
|
protectedinherited |
◆ internalOnPoll()
err_t TcpConnection::internalOnPoll |
( |
| ) |
|
|
protectedinherited |
◆ internalOnReceive()
err_t TcpConnection::internalOnReceive |
( |
pbuf * |
p, |
|
|
err_t |
err |
|
) |
| |
|
protectedinherited |
◆ internalOnSent()
err_t TcpConnection::internalOnSent |
( |
uint16_t |
len | ) |
|
|
protectedinherited |
◆ isProcessing()
bool TcpClient::isProcessing |
( |
| ) |
|
|
inline |
◆ onConnected()
err_t TcpClient::onConnected |
( |
err_t |
err | ) |
|
|
overrideprotectedvirtual |
◆ onError()
void TcpClient::onError |
( |
err_t |
err | ) |
|
|
overrideprotectedvirtual |
◆ onFinished()
◆ onPoll()
virtual err_t TcpConnection::onPoll |
( |
| ) |
|
|
protectedvirtualinherited |
◆ onReadyToSendData()
◆ onReceive()
err_t TcpClient::onReceive |
( |
pbuf * |
buf | ) |
|
|
overrideprotectedvirtual |
◆ onSent()
◆ pushAsyncPart()
void TcpClient::pushAsyncPart |
( |
| ) |
|
|
protected |
◆ send()
bool TcpClient::send |
( |
const char * |
data, |
|
|
uint16_t |
len, |
|
|
bool |
forceCloseAfterSent = false |
|
) |
| |
◆ sendString()
bool TcpClient::sendString |
( |
const String & |
data, |
|
|
bool |
forceCloseAfterSent = false |
|
) |
| |
|
inline |
◆ setBuffer()
◆ setCloseAfterSent()
void TcpClient::setCloseAfterSent |
( |
bool |
ignoreIncomingData = false | ) |
|
|
inline |
Schedules the connection to get closed after the data is sent
- Parameters
-
ignoreIncomingData | when that flag is set the connection will start ignoring incoming data. |
◆ setCompleteDelegate()
Set or clear the callback for connection close.
- Parameters
-
completeCb | callback delegate or nullptr |
◆ setDestroyedDelegate()
Sets a callback to be called when the object instance is destroyed.
- Parameters
-
◆ setReceiveDelegate()
Set or clear the callback for received data.
- Parameters
-
receiveCb | callback delegate or nullptr |
◆ setSslConnection()
◆ setSslInitHandler()
Set the SSL session initialisation callback.
- Parameters
-
◆ setTimeOut()
void TcpConnection::setTimeOut |
( |
uint16_t |
waitTimeOut | ) |
|
|
inherited |
◆ sslCreateSession()
bool TcpConnection::sslCreateSession |
( |
| ) |
|
|
protectedinherited |
◆ sslInitSession()
virtual void TcpConnection::sslInitSession |
( |
Ssl::Session & |
session | ) |
|
|
inlineprotectedvirtualinherited |
Override in inherited classes to perform custom session initialisation.
Called when TCP connection is established before initiating handshake.
Reimplemented in HttpClientConnection.
◆ trySend()
◆ write() [1/2]
virtual int TcpConnection::write |
( |
const char * |
data, |
|
|
int |
len, |
|
|
uint8_t |
apiflags = TCP_WRITE_FLAG_COPY |
|
) |
| |
|
virtualinherited |
Base write operation.
- Parameters
-
data | |
len | |
apiflags | TCP_WRITE_FLAG_COPY, TCP_WRITE_FLAG_MORE |
- Return values
-
Reimplemented in FtpDataStream.
◆ write() [2/2]
◆ writeString() [1/2]
int TcpConnection::writeString |
( |
const char * |
data, |
|
|
uint8_t |
apiflags = TCP_WRITE_FLAG_COPY |
|
) |
| |
|
inlineinherited |
◆ writeString() [2/2]
int TcpConnection::writeString |
( |
const String & |
data, |
|
|
uint8_t |
apiflags = TCP_WRITE_FLAG_COPY |
|
) |
| |
|
inlineinherited |
◆ autoSelfDestruct
bool TcpConnection::autoSelfDestruct = true |
|
protectedinherited |
◆ buffer
Used internally to buffer arbitrary data via send() methods.
◆ canSend
bool TcpConnection::canSend = true |
|
protectedinherited |
◆ sleep
◆ ssl
◆ sslInit
◆ stream
The currently active stream being sent.
◆ tcp
tcp_pcb* TcpConnection::tcp = nullptr |
|
protectedinherited |
◆ timeOut
uint16_t TcpConnection::timeOut = USHRT_MAX |
|
protectedinherited |
By default a TCP connection does not have a time out.
◆ useSsl
bool TcpConnection::useSsl = false |
|
protectedinherited |
The documentation for this class was generated from the following file: