TcpConnection.h
Go to the documentation of this file.
int writeString(const String &data, uint8_t apiflags=TCP_WRITE_FLAG_COPY)
Writes string data directly to the TCP buffer.
Definition: TcpConnection.h:73
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:43
Definition: TcpConnection.h:28
uint16_t timeOut
By default a TCP connection does not have a time out.
Definition: TcpConnection.h:220
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:641
void setSslInitHandler(Ssl::Session::InitDelegate handler)
Set the SSL session initialisation callback.
Definition: TcpConnection.h:125
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:148
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:131
void setTimeOut(uint16_t waitTimeOut)
virtual int write(const char *data, int len, uint8_t apiflags=TCP_WRITE_FLAG_COPY)
Base write operation.
Server server
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:237
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:116
Definition: IpConnection.h:21
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)
Writes string data directly to the TCP buffer.
Definition: TcpConnection.h:63
virtual void onError(err_t err)
virtual void onClosed()
Gets called when there is/was a tcp connection, the latter does not have to be established, that is closed due to error or normal disconnect.
Definition: TcpConnection.h:182
virtual void sslInitSession(Ssl::Session &session)
Override in inherited classes to perform custom session initialisation.
Definition: TcpConnection.h:164
err_t internalOnReceive(pbuf *p, err_t err)