Lines Matching defs:sockfd
377 int eidx, cidx, sockfd;
452 sockfd = vs_eng_connect(eng_ctx->vse_host, eng_ctx->vse_port);
455 if (sockfd == -1) {
457 sockfd = vs_eng_connect(eng_ctx->vse_host, eng_ctx->vse_port);
460 if (sockfd == -1) {
489 cxn->vsc_sockfd = sockfd;
490 eng_ctx->vse_sockfd = sockfd;
695 * Returns: sockfd or -1 (error)
700 int rc, sockfd, opt_nodelay, opt_keepalive, opt_reuseaddr, err_num;
704 if ((sockfd = socket(AF_INET, SOCK_STREAM, 0)) == -1)
709 (void) close(sockfd);
720 rc = nbio_connect(sockfd, (struct sockaddr *)&addr,
723 rc = connect(sockfd, (struct sockaddr *)&addr,
732 (setsockopt(sockfd, IPPROTO_TCP, TCP_NODELAY,
734 (setsockopt(sockfd, SOL_SOCKET, SO_KEEPALIVE,
736 (setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR,
738 (void) close(sockfd);
742 return (sockfd);
755 nbio_connect(int sockfd, const struct sockaddr *sa, int sa_len)
762 if ((ioctl(sockfd, FIONBIO, &nbio)) < 0)
763 return (connect(sockfd, sa, sa_len));
765 if ((rc = connect(sockfd, sa, sa_len)) != 0) {
768 pfd.fd = sockfd;
782 rc = getsockopt(sockfd, SOL_SOCKET,
794 (void) ioctl(sockfd, FIONBIO, &nbio);