Lines Matching refs:tcpfd
816 if ((last_server->tcpfd == -1) &&
817 (last_server->tcpfd = socket(last_server->addr.sa.sa_family, SOCK_STREAM, 0)) != -1 &&
818 (!local_bind(last_server->tcpfd, &last_server->source_addr, last_server->interface, 1) ||
819 connect(last_server->tcpfd, &last_server->addr.sa, sa_len(&last_server->addr)) == -1))
821 close(last_server->tcpfd);
822 last_server->tcpfd = -1;
825 if (last_server->tcpfd == -1)
831 if (!read_write(last_server->tcpfd, &c1, 1, 0) ||
832 !read_write(last_server->tcpfd, &c2, 1, 0) ||
833 !read_write(last_server->tcpfd, packet, size, 0) ||
834 !read_write(last_server->tcpfd, &c1, 1, 1) ||
835 !read_write(last_server->tcpfd, &c2, 1, 1))
837 close(last_server->tcpfd);
838 last_server->tcpfd = -1;
843 if (!read_write(last_server->tcpfd, packet, m, 1))