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
  }
}
Ejemplo n.º 2
0
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
  }
}
Ejemplo n.º 3
0
int tcpConnect(String ip) {
    byte address[4];
    ipArrayFromString(address, ip);
    if (tcp.connect(address, tcpPort)) {
        tcpKeepAliveReset();
        return 1;
    } else {
        return -1;
    }
}