Syntax
virtual int connect(
    IPAddress ip, 
    uint16_t port
);
ContentsIndex
PreviousUpNext
LTcpClient::connect Method (IPAddress, uint16_t)
LTcpClient Class | Example
Syntax
virtual int connect(
    IPAddress ip, 
    uint16_t port
);
Description

Connects to a TCP server.

Parameters
Parameters 
Description 
uint16_t port 
TCP port to be connected
 
IPAddress 
IPAddress object, e.g. IPAddress server (172, 21, 84, 11), that denotes server address
 
Returns

1 if connected, 0 otherwise. 

 

Example
    IPAddress server("127.0.0.1");
    client.connect(server, 80);  // client is an instance of LWiFiClient or LGPRSClient.
File

LTcpClient.h

Class