User Manual

In specialised cases (mostly when implementing sub-classes of AdafruitTCP) you may need access to the 'handle' for
the TCP socket. The .getHandle function provides access to this.
void getHandle (void)
Returns the internal TCP socket handler value that uniquely identifies this TCP socket. This might be necessary when
creating special sub-classes based on AdafruitTCP.
Parameters: None
Returns: The uint32_t socket handler value that uniquely identifies this TCP socket.
Client API
The Client API (https://adafru.it/lFj) includes the following functions to connect to a TCP server:
int connect (IPAddress ip, uint16_t port)
Attempts to connect to the specified IP address and port
Parameters:
ip: The IPAddress (https://adafru.it/lGd) where the TCP server is located
port: The port number to connect to (0..65535)
Returns: 'true' (1) if the connection was successfully established, otherwise 'false' (0).
int connect (const char * host, uint16_t port)
Attempts to connect to the specified domain name and port
Parameters:
host: A string containing the domain name to connect to
port: The port number to connect to (0..65536)
Returns: 'true' (1) if the connection was successfully established, otherwise 'false' (0).
int connectSSL (IPAddress ip, uint16_t port)
Connects to a secure server using SSL/TLS at the specified IP address and port.
Parameters:
ip: The IPAddress (https://adafru.it/lGd) where the TCP server is located
port: The port number to connect to (0..65536)
Returns: 'true' (1) if the connection was successfully established, otherwise 'false' (0).
If certificate verification fails when trying to connect to a secure server you will get
ERROR_TLS_UNTRUSTED_CERTIFICATE (5035).
© Adafruit Industries https://learn.adafruit.com/introducing-the-adafruit-wiced-feather-wifi Page 76 of 202