TCPClient

connect()

TCPClient::connect, connect, TCPClient.connect

Connects to a specified IP address and port. The return value indicates success or failure. Also supports DNS lookups when using a domain name.

// SYNTAX
client.connect();
client.connect(ip, port);
client.connect(hostname, port);

Parameters:

  • ip: the IP address that the client will connect to (array of 4 bytes)
  • hostname: the host name the client will connect to (string, ex.:"particle.io")
  • port: the port that the client will connect to (int)

Returns true if the connection succeeds, false if not.