rem: debug_v("core_udp_connect(host=%p, port=%hu, timeout=%d)", (void *)host,
add: debug_v("core_tcp_connect(host=%p, port=%hu, timeout=%d)", (void *)host,
context: int core_tcp_connect(struct in_addr *host, unsigned short port, int timeout){  int ret, sock;  struct timeval timest;  fd_set ins;  fd_set outs;  debug_v("core_udp_connect(host=%p, port=%hu, timeout=%d)", (void *)host,	  port, timeout);  debug_dv("Trying TCP connection to %s[:%hu]", netcat_inet_ntop(host), port);  /* since we are nonblocking now, we can start as many connections as we want     but it's not a great idea connecting more than one host at time */  sock = netcat_socket_new_connect(PF_INET, SOCK_STREAM, host, port,			NULL, (opt_tunnel ? 0 : local_port.num));  /* FIXME: we should use our specified address (if any) */  /* FIXME: missing some vital checks about the creation of that socket */  assert(sock > 0);  /* initialize select()'s variables */  FD_ZERO(&ins);  FD_ZERO(&outs);  FD_SET(sock, &ins);  FD_SET(sock, &outs);  timest.tv_sec = timeout;  timest.tv_usec = 0;  /* FIXME: what happens if: Connection Refused, or calling select on an already     connected host */  select(sock + 1, &ins, &outs, NULL, (timeout > 0 ? &timest : NULL));  /* FIXME: why do i get both these? */  if (FD_ISSET(sock, &ins)) {    char tmp;    debug_v("Connect-flag: ins");    /* since the select() returned flag set for reading, this means that EOF       arrived on a closed socket, which means that the connection failed.       Because of this, a read() on that socket MUST fail. */    ret = read(sock, &tmp, 1);    assert(ret < 0);    close(sock);    return -1;			/* FIXME: close() MAY overwrite errno */  }  /* connection was successful, this is the right thing to return */  if (FD_ISSET(sock, &outs)) {    debug_v("Connect-flag: outs");    return sock;  }  /* FIXME: i don't remember what is this and WHY this is here */  if (!FD_ISSET(sock, &ins) && !FD_ISSET(sock, &outs)) {    errno = ETIMEDOUT;    return -1;  }  return -1;}