TcpConnection.h
Go to the documentation of this file.
int writeString(const String &data, uint8_t apiflags=TCP_WRITE_FLAG_COPY)
Definition: TcpConnection.h:65
virtual void onReadyToSendData(TcpConnectionEvent sourceEvent)
void internalOnDnsResponse(const char *name, LWIP_IP_ADDR_T *ipaddr, int port)
A class to make it easier to handle and pass around IP addresses.
Definition: IpAddress.h:37
Definition: TcpConnection.h:28
uint16_t timeOut
By default a TCP connection does not have a time out.
Definition: TcpConnection.h:199
bool internalConnect(IpAddress addr, uint16_t port)
virtual err_t onPoll()
const char * c_str() const
Get a constant (un-modifiable) pointer to String content.
Definition: WString.h:600
void setSslInitHandler(Ssl::Session::InitDelegate handler)
Set the SSL session initialisation callback.
Definition: TcpConnection.h:112
virtual err_t onSent(uint16_t len)
virtual bool connect(const String &server, int port, bool useSsl=false)
virtual void close()
Definition: TcpConnection.h:29
Ssl::Session * getSsl()
Get a pointer to the current SSL session object.
Definition: TcpConnection.h:135
Delegate< void(TcpConnection &)> TcpConnectionDestroyedDelegate
Definition: TcpConnection.h:35
Definition: TcpConnection.h:39
bool sslCreateSession()
virtual ~TcpConnection()
err_t internalOnPoll()
void setConnection(Connection *connection)
Called by TcpConnection to set the established SSL connection.
Definition: Session.h:148
virtual err_t onConnected(err_t err)
bool setSslConnection(Ssl::Connection *connection)
Definition: TcpConnection.h:118
void setTimeOut(uint16_t waitTimeOut)
virtual int write(const char *data, int len, uint8_t apiflags=TCP_WRITE_FLAG_COPY)
Base write operation.
TcpConnection(tcp_pcb *connection, bool autoDestruct)
Definition: TcpConnection.h:46
size_t length(void) const
Obtain the String length in characters, excluding NUL terminator.
Definition: WString.h:228
void flush()
err_t internalOnConnected(err_t err)
void setDestroyedDelegate(TcpConnectionDestroyedDelegate destroyedDelegate)
Sets a callback to be called when the object instance is destroyed.
Definition: TcpConnection.h:103
void internalOnError(err_t err)
virtual err_t onReceive(pbuf *buf)
err_t internalOnSent(uint16_t len)
void initialize(tcp_pcb *pcb)
int writeString(const char *data, uint8_t apiflags=TCP_WRITE_FLAG_COPY)
Definition: TcpConnection.h:59
virtual void onError(err_t err)
virtual void sslInitSession(Ssl::Session &session)
Override in inherited classes to perform custom session initialisation.
Definition: TcpConnection.h:151
err_t internalOnReceive(pbuf *p, err_t err)