tep.c 283 字节
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20


int taosGetFqdnPortFromEp(const char *ep, char *fqdn, uint16_t *port) {
  *port = 0;
  strcpy(fqdn, ep);

  char *temp = strchr(fqdn, ':');
  if (temp) {
    *temp = 0;
    *port = atoi(temp+1);
  }

  if (*port == 0) {
    *port = tsServerPort;
    return -1;
  }

  return 0;
}