src/solaris/native/java/net/PlainDatagramSocketImpl.c

Print this page

        

*** 499,509 **** if (IS_NULL(addressObj)) { JNU_ThrowNullPointerException(env, "Null address in peek()"); return -1; } if (timeout) { ! int ret = NET_Timeout(fd, timeout); if (ret == 0) { JNU_ThrowByName(env, JNU_JAVANETPKG "SocketTimeoutException", "Peek timed out"); return ret; } else if (ret == -1) { --- 499,510 ---- if (IS_NULL(addressObj)) { JNU_ThrowNullPointerException(env, "Null address in peek()"); return -1; } if (timeout) { ! int ret = NET_Timeout(env, fd, timeout); ! JNU_CHECK_EXCEPTION_RETURN(env, -1); if (ret == 0) { JNU_ThrowByName(env, JNU_JAVANETPKG "SocketTimeoutException", "Peek timed out"); return ret; } else if (ret == -1) {
*** 592,602 **** return -1; } packetBufferOffset = (*env)->GetIntField(env, packet, dp_offsetID); packetBufferLen = (*env)->GetIntField(env, packet, dp_bufLengthID); if (timeout) { ! int ret = NET_Timeout(fd, timeout); if (ret == 0) { JNU_ThrowByName(env, JNU_JAVANETPKG "SocketTimeoutException", "Receive timed out"); return -1; } else if (ret == -1) { --- 593,604 ---- return -1; } packetBufferOffset = (*env)->GetIntField(env, packet, dp_offsetID); packetBufferLen = (*env)->GetIntField(env, packet, dp_bufLengthID); if (timeout) { ! int ret = NET_Timeout(env, fd, timeout); ! JNU_CHECK_EXCEPTION_RETURN(env, -1); if (ret == 0) { JNU_ThrowByName(env, JNU_JAVANETPKG "SocketTimeoutException", "Receive timed out"); return -1; } else if (ret == -1) {
*** 800,812 **** do { retry = JNI_FALSE; if (timeout) { ! int ret = NET_Timeout(fd, timeout); if (ret <= 0) { ! if (ret == 0) { JNU_ThrowByName(env, JNU_JAVANETPKG "SocketTimeoutException", "Receive timed out"); } else if (ret == -1) { #ifdef __linux__ if (errno == EBADF) { --- 802,816 ---- do { retry = JNI_FALSE; if (timeout) { ! int ret = NET_Timeout(env, fd, timeout); if (ret <= 0) { ! if ((*env)->ExceptionCheck(env)) { ! // fall-through, to potentially free, then return ! } else if (ret == 0) { JNU_ThrowByName(env, JNU_JAVANETPKG "SocketTimeoutException", "Receive timed out"); } else if (ret == -1) { #ifdef __linux__ if (errno == EBADF) {