int connectToMyServer(String ip) { byte serverAddress[4]; ipArrayFromString(serverAddress, ip); if (client.connect(serverAddress, 9000)) { return 1; // successfully connected } else { return -1; // failed to connect } }
int ClientTCP::connectToMyServer(String ipPort) { byte serverAddress[4]; int port = ipArrayFromString(serverAddress, ipPort); if (client.connect(serverAddress, port)) { return 1; // successfully connected } else { return -1; // failed to connect } }
int tcpConnect(String ip) { byte address[4]; ipArrayFromString(address, ip); if (tcp.connect(address, tcpPort)) { tcpKeepAliveReset(); return 1; } else { return -1; } }