< prev index next >

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

Print this page




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


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