Lines Matching defs:fd
440 #define SET_NONBLOCKING(fd) { \
441 int flags = fcntl(fd, F_GETFL); \
443 fcntl(fd, F_SETFL, flags); \
448 ping6(JNIEnv *env, jint fd, struct sockaddr_in6* him, jint timeout,
471 setsockopt(fd, SOL_RAW, IPV6_CHECKSUM, &csum_offset, sizeof(int));
480 setsockopt(fd, SOL_SOCKET, SO_RCVBUF, &size, sizeof(size));
482 setsockopt(fd, IPPROTO_IPV6, IPV6_UNICAST_HOPS, &ttl, sizeof(ttl));
485 if (bind(fd, (struct sockaddr*)netif, sizeof(struct sockaddr_in6)) <0) {
487 close(fd);
491 SET_NONBLOCKING(fd);
505 n = sendto(fd, sendbuf, plen, 0, (struct sockaddr*) him, sizeof(struct sockaddr_in6));
516 close(fd);
522 tmout2 = NET_Wait(env, fd, NET_WAIT_READ, tmout2);
526 n = recvfrom(fd, recvbuf, sizeof(recvbuf), 0, (struct sockaddr*) &sa_recv, &len);
537 close(fd);
541 close(fd);
549 close(fd);
568 jint fd, sz;
629 fd = JVM_Socket(AF_INET6, SOCK_RAW, IPPROTO_ICMPV6);
631 if (fd != -1) { /* Good to go, let's do a ping */
632 return ping6(env, fd, &him6, timeout, netif, ttl);
636 fd = JVM_Socket(AF_INET6, SOCK_STREAM, 0);
637 if (fd == JVM_IO_ERR) {
646 setsockopt(fd, IPPROTO_IPV6, IPV6_UNICAST_HOPS, &ttl, sizeof(ttl));
653 if (bind(fd, (struct sockaddr*)netif, sizeof(struct sockaddr_in6)) <0) {
655 close(fd);
659 SET_NONBLOCKING(fd);
663 connect_rv = JVM_Connect(fd, (struct sockaddr *)&him6, len);
670 close(fd);
688 close(fd);
695 close(fd);
699 timeout = NET_Wait(env, fd, NET_WAIT_CONNECT, timeout);
704 if (JVM_GetSockOpt(fd, SOL_SOCKET, SO_ERROR, (void*)&connect_rv,
709 close(fd);
713 close(fd);