< prev index next >

src/java.base/unix/native/libnio/ch/Net.c

Print this page




 730 Java_sun_nio_ch_Net_pollhupValue(JNIEnv *env, jclass this)
 731 {
 732     return (jshort)POLLHUP;
 733 }
 734 
 735 JNIEXPORT jshort JNICALL
 736 Java_sun_nio_ch_Net_pollnvalValue(JNIEnv *env, jclass this)
 737 {
 738     return (jshort)POLLNVAL;
 739 }
 740 
 741 JNIEXPORT jshort JNICALL
 742 Java_sun_nio_ch_Net_pollconnValue(JNIEnv *env, jclass this)
 743 {
 744     return (jshort)POLLOUT;
 745 }
 746 
 747 
 748 /* Declared in nio_util.h */
 749 
 750 jint
 751 handleSocketError(JNIEnv *env, jint errorValue)
 752 {
 753     char *xn;
 754     switch (errorValue) {
 755         case EINPROGRESS:       /* Non-blocking connect */
 756             return 0;
 757 #ifdef EPROTO
 758         case EPROTO:
 759             xn = JNU_JAVANETPKG "ProtocolException";
 760             break;
 761 #endif
 762         case ECONNREFUSED:
 763         case ETIMEDOUT:
 764         case ENOTCONN:
 765             xn = JNU_JAVANETPKG "ConnectException";
 766             break;
 767 
 768         case EHOSTUNREACH:
 769             xn = JNU_JAVANETPKG "NoRouteToHostException";
 770             break;


 730 Java_sun_nio_ch_Net_pollhupValue(JNIEnv *env, jclass this)
 731 {
 732     return (jshort)POLLHUP;
 733 }
 734 
 735 JNIEXPORT jshort JNICALL
 736 Java_sun_nio_ch_Net_pollnvalValue(JNIEnv *env, jclass this)
 737 {
 738     return (jshort)POLLNVAL;
 739 }
 740 
 741 JNIEXPORT jshort JNICALL
 742 Java_sun_nio_ch_Net_pollconnValue(JNIEnv *env, jclass this)
 743 {
 744     return (jshort)POLLOUT;
 745 }
 746 
 747 
 748 /* Declared in nio_util.h */
 749 
 750 JNIEXPORT jint JNICALL
 751 handleSocketError(JNIEnv *env, jint errorValue)
 752 {
 753     char *xn;
 754     switch (errorValue) {
 755         case EINPROGRESS:       /* Non-blocking connect */
 756             return 0;
 757 #ifdef EPROTO
 758         case EPROTO:
 759             xn = JNU_JAVANETPKG "ProtocolException";
 760             break;
 761 #endif
 762         case ECONNREFUSED:
 763         case ETIMEDOUT:
 764         case ENOTCONN:
 765             xn = JNU_JAVANETPKG "ConnectException";
 766             break;
 767 
 768         case EHOSTUNREACH:
 769             xn = JNU_JAVANETPKG "NoRouteToHostException";
 770             break;
< prev index next >