mirror of
https://github.com/2003scape/deep-c-rsc.git
synced 2024-03-22 05:49:51 -04:00
1773 lines
48 KiB
C
1773 lines
48 KiB
C
/* DO NOT EDIT THIS FILE - it is machine generated (JCGO_116) */
|
|
|
|
#ifdef JCGO_SEPARATED
|
|
#define JCGO_116
|
|
#include "jcgortl.h"
|
|
#include "Main.h"
|
|
#endif
|
|
|
|
#ifdef JCGO_116
|
|
|
|
#ifdef CHKALL_gnu_java_net_VMPlainSocketImpl
|
|
#include "jcgobchk.h"
|
|
#endif
|
|
|
|
JCGO_NOSEP_INLINE void CFASTCALL
|
|
gnu_java_net_VMPlainSocketImpl__void( gnu_java_net_VMPlainSocketImpl
|
|
This )
|
|
{
|
|
JCGO_FIELD_NZACCESS(This, state)= (gnu_java_net_VMPlainSocketImpl_State__new__L8vgeu(
|
|
This));
|
|
}
|
|
|
|
JCGO_NOSEP_INLINE jint CFASTCALL
|
|
gnu_java_net_VMPlainSocketImpl__socketsInit0__( void )
|
|
{
|
|
#ifdef NOJAVA_gnu_java_net_VMPlainSocketImpl_socketsInit0
|
|
jcgo_jniNoNativeFunc();
|
|
return (jint)0;
|
|
#else
|
|
jint jcgo_retval;
|
|
JCGO_JNI_BLOCK(0)
|
|
jcgo_retval= JCGO_JNI_FUNC(Java_gnu_java_net_VMPlainSocketImpl_socketsInit0)(jcgo_pJniEnv,
|
|
(jclass)JCGO_JNI_TOLOCALREF(0, JCGO_CLASSREF_OF(gnu_java_net_VMPlainSocketImpl__class)));
|
|
jcgo_jniLeave(jcgo_pJniEnv, NULL);
|
|
return jcgo_retval;
|
|
#endif
|
|
}
|
|
|
|
JCGO_NOSEP_INLINE jint CFASTCALL
|
|
gnu_java_net_VMPlainSocketImpl__isSocketErrResetConn0__I( jint res
|
|
)
|
|
{
|
|
#ifdef NOJAVA_gnu_java_net_VMPlainSocketImpl_isSocketErrResetConn0
|
|
jcgo_jniNoNativeFunc();
|
|
return (jint)0;
|
|
#else
|
|
jint jcgo_retval;
|
|
JCGO_JNI_BLOCK(0)
|
|
jcgo_retval= JCGO_JNI_FUNC(Java_gnu_java_net_VMPlainSocketImpl_isSocketErrResetConn0)(jcgo_pJniEnv,
|
|
(jclass)JCGO_JNI_TOLOCALREF(0, JCGO_CLASSREF_OF(gnu_java_net_VMPlainSocketImpl__class)),
|
|
res);
|
|
jcgo_jniLeave(jcgo_pJniEnv, NULL);
|
|
return jcgo_retval;
|
|
#endif
|
|
}
|
|
|
|
JCGO_NOSEP_INLINE jint CFASTCALL
|
|
gnu_java_net_VMPlainSocketImpl__socketCreate0__IAI( jintArr resArr,
|
|
jint stream )
|
|
{
|
|
#ifdef NOJAVA_gnu_java_net_VMPlainSocketImpl_socketCreate0
|
|
jcgo_jniNoNativeFunc();
|
|
return (jint)0;
|
|
#else
|
|
jint jcgo_retval;
|
|
JCGO_JNI_BLOCK(1)
|
|
jcgo_retval= JCGO_JNI_FUNC(Java_gnu_java_net_VMPlainSocketImpl_socketCreate0)(jcgo_pJniEnv,
|
|
(jclass)JCGO_JNI_TOLOCALREF(0, JCGO_CLASSREF_OF(gnu_java_net_VMPlainSocketImpl__class)),
|
|
(jintArray)JCGO_JNI_TOLOCALREF(1, resArr), stream);
|
|
jcgo_jniLeave(jcgo_pJniEnv, NULL);
|
|
return jcgo_retval;
|
|
#endif
|
|
}
|
|
|
|
JCGO_NOSEP_INLINE jint CFASTCALL
|
|
gnu_java_net_VMPlainSocketImpl__isSocketErrNoResources0__I( jint res
|
|
)
|
|
{
|
|
#ifdef NOJAVA_gnu_java_net_VMPlainSocketImpl_isSocketErrNoResources0
|
|
jcgo_jniNoNativeFunc();
|
|
return (jint)0;
|
|
#else
|
|
jint jcgo_retval;
|
|
JCGO_JNI_BLOCK(0)
|
|
jcgo_retval= JCGO_JNI_FUNC(Java_gnu_java_net_VMPlainSocketImpl_isSocketErrNoResources0)(jcgo_pJniEnv,
|
|
(jclass)JCGO_JNI_TOLOCALREF(0, JCGO_CLASSREF_OF(gnu_java_net_VMPlainSocketImpl__class)),
|
|
res);
|
|
jcgo_jniLeave(jcgo_pJniEnv, NULL);
|
|
return jcgo_retval;
|
|
#endif
|
|
}
|
|
|
|
JCGO_NOSEP_INLINE jint CFASTCALL
|
|
gnu_java_net_VMPlainSocketImpl__socketClose0__I( jint fd )
|
|
{
|
|
#ifdef NOJAVA_gnu_java_net_VMPlainSocketImpl_socketClose0
|
|
jcgo_jniNoNativeFunc();
|
|
return (jint)0;
|
|
#else
|
|
jint jcgo_retval;
|
|
JCGO_JNI_BLOCK(0)
|
|
jcgo_retval= JCGO_JNI_FUNC(Java_gnu_java_net_VMPlainSocketImpl_socketClose0)(jcgo_pJniEnv,
|
|
(jclass)JCGO_JNI_TOLOCALREF(0, JCGO_CLASSREF_OF(gnu_java_net_VMPlainSocketImpl__class)),
|
|
fd);
|
|
jcgo_jniLeave(jcgo_pJniEnv, NULL);
|
|
return jcgo_retval;
|
|
#endif
|
|
}
|
|
|
|
JCGO_NOSEP_INLINE void CFASTCALL
|
|
gnu_java_net_VMPlainSocketImpl__checkIOSockResCode__I( jint res )
|
|
{
|
|
{
|
|
(gnu_java_net_VMPlainSocketImpl__checkSocketResCode__I(
|
|
res));
|
|
}
|
|
}
|
|
|
|
JCGO_NOSEP_INLINE void CFASTCALL
|
|
gnu_java_net_VMPlainSocketImpl__checkThreadInterrupted__( void )
|
|
{
|
|
{
|
|
if ((java_lang_Thread__interrupted__()))
|
|
{
|
|
JCGO_THROW_EXC(java_io_InterruptedIOException__new__());
|
|
}
|
|
}
|
|
}
|
|
|
|
JCGO_NOSEP_INLINE jlong CFASTCALL
|
|
gnu_java_net_VMPlainSocketImpl__getDeadlineTime__I( jint timeout )
|
|
{
|
|
{
|
|
return (java_lang_System__currentTimeMillis__()) + (jlong)timeout;
|
|
}
|
|
}
|
|
|
|
JCGO_NOSEP_INLINE jint CFASTCALL
|
|
gnu_java_net_VMPlainSocketImpl__socketShutdown0__III( jint fd, jint
|
|
input, jint output )
|
|
{
|
|
#ifdef NOJAVA_gnu_java_net_VMPlainSocketImpl_socketShutdown0
|
|
jcgo_jniNoNativeFunc();
|
|
return (jint)0;
|
|
#else
|
|
jint jcgo_retval;
|
|
JCGO_JNI_BLOCK(0)
|
|
jcgo_retval= JCGO_JNI_FUNC(Java_gnu_java_net_VMPlainSocketImpl_socketShutdown0)(jcgo_pJniEnv,
|
|
(jclass)JCGO_JNI_TOLOCALREF(0, JCGO_CLASSREF_OF(gnu_java_net_VMPlainSocketImpl__class)),
|
|
fd, input, output);
|
|
jcgo_jniLeave(jcgo_pJniEnv, NULL);
|
|
return jcgo_retval;
|
|
#endif
|
|
}
|
|
|
|
JCGO_NOSEP_INLINE void CFASTCALL
|
|
gnu_java_net_VMPlainSocketImpl__socketShutdown__IZZ( jint fd, jboolean
|
|
input, jboolean output )
|
|
{
|
|
{
|
|
if (input || output)
|
|
{
|
|
jint res;
|
|
do
|
|
{
|
|
res= (gnu_java_net_VMPlainSocketImpl__socketShutdown0__III(
|
|
fd, input? (jint)1 : 0, output? (jint)1 : 0));
|
|
}
|
|
while (res < 0 && (gnu_java_net_VMPlainSocketImpl__isSocketErrInterrupted0__I(
|
|
res)) != 0);
|
|
(gnu_java_net_VMPlainSocketImpl__checkIOSockResCode__I(
|
|
res));
|
|
}
|
|
}
|
|
}
|
|
|
|
JCGO_NOSEP_INLINE jint CFASTCALL
|
|
gnu_java_net_VMPlainSocketImpl__isSocketErrConnRefused0__I( jint res
|
|
)
|
|
{
|
|
#ifdef NOJAVA_gnu_java_net_VMPlainSocketImpl_isSocketErrConnRefused0
|
|
jcgo_jniNoNativeFunc();
|
|
return (jint)0;
|
|
#else
|
|
jint jcgo_retval;
|
|
JCGO_JNI_BLOCK(0)
|
|
jcgo_retval= JCGO_JNI_FUNC(Java_gnu_java_net_VMPlainSocketImpl_isSocketErrConnRefused0)(jcgo_pJniEnv,
|
|
(jclass)JCGO_JNI_TOLOCALREF(0, JCGO_CLASSREF_OF(gnu_java_net_VMPlainSocketImpl__class)),
|
|
res);
|
|
jcgo_jniLeave(jcgo_pJniEnv, NULL);
|
|
return jcgo_retval;
|
|
#endif
|
|
}
|
|
|
|
JCGO_NOSEP_INLINE jint CFASTCALL
|
|
gnu_java_net_VMPlainSocketImpl__socketBind0__IBAII( jbyteArr ip, jint
|
|
fd, jint iplen, jint port )
|
|
{
|
|
#ifdef NOJAVA_gnu_java_net_VMPlainSocketImpl_socketBind0
|
|
jcgo_jniNoNativeFunc();
|
|
return (jint)0;
|
|
#else
|
|
jint jcgo_retval;
|
|
JCGO_JNI_BLOCK(1)
|
|
jcgo_retval= JCGO_JNI_FUNC(Java_gnu_java_net_VMPlainSocketImpl_socketBind0)(jcgo_pJniEnv,
|
|
(jclass)JCGO_JNI_TOLOCALREF(0, JCGO_CLASSREF_OF(gnu_java_net_VMPlainSocketImpl__class)),
|
|
fd, (jbyteArray)JCGO_JNI_TOLOCALREF(1, ip), iplen, port);
|
|
jcgo_jniLeave(jcgo_pJniEnv, NULL);
|
|
return jcgo_retval;
|
|
#endif
|
|
}
|
|
|
|
JCGO_NOSEP_INLINE void CFASTCALL
|
|
gnu_java_net_VMPlainSocketImpl__socketBind__IL7lnuwI( java_net_InetAddress
|
|
addr, jint fd, jint port )
|
|
{
|
|
{
|
|
jbyteArr ip;
|
|
jint res;
|
|
jboolean retrying;
|
|
ip= (JCGO_CALL_VFUNC(addr)->getAddress__(
|
|
addr));
|
|
retrying= jfalse;
|
|
do
|
|
{
|
|
res= (gnu_java_net_VMPlainSocketImpl__socketBind0__IBAII(
|
|
ip, fd, JCGO_ARRAY_LENGTH(ip), port));
|
|
if (!retrying && (gnu_java_net_VMPlainSocketImpl__isSocketRetryNeededOnce__I(
|
|
res)))
|
|
{
|
|
retrying= (jboolean)jtrue;
|
|
}
|
|
else
|
|
{
|
|
if (res >= 0 || (gnu_java_net_VMPlainSocketImpl__isSocketErrInterrupted0__I(
|
|
res)) == 0)
|
|
{
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
while (jtrue);
|
|
(gnu_java_net_VMPlainSocketImpl__checkSocketResCode__I(
|
|
res));
|
|
}
|
|
}
|
|
|
|
JCGO_NOSEP_INLINE jint CFASTCALL
|
|
gnu_java_net_VMPlainSocketImpl__socketGetLocalAddrPort0__IBAIIA( jbyteArr
|
|
ip, jintArr portArr, jint fd, jint ipmaxlen )
|
|
{
|
|
#ifdef NOJAVA_gnu_java_net_VMPlainSocketImpl_socketGetLocalAddrPort0
|
|
jcgo_jniNoNativeFunc();
|
|
return (jint)0;
|
|
#else
|
|
jint jcgo_retval;
|
|
JCGO_JNI_BLOCK(2)
|
|
jcgo_retval= JCGO_JNI_FUNC(Java_gnu_java_net_VMPlainSocketImpl_socketGetLocalAddrPort0)(jcgo_pJniEnv,
|
|
(jclass)JCGO_JNI_TOLOCALREF(0, JCGO_CLASSREF_OF(gnu_java_net_VMPlainSocketImpl__class)),
|
|
fd, (jbyteArray)JCGO_JNI_TOLOCALREF(1, ip), ipmaxlen, (jintArray)JCGO_JNI_TOLOCALREF(2,
|
|
portArr));
|
|
jcgo_jniLeave(jcgo_pJniEnv, NULL);
|
|
return jcgo_retval;
|
|
#endif
|
|
}
|
|
|
|
JCGO_NOSEP_INLINE jint CFASTCALL
|
|
gnu_java_net_VMPlainSocketImpl__socketAvailable0__I( jint fd )
|
|
{
|
|
#ifdef NOJAVA_gnu_java_net_VMPlainSocketImpl_socketAvailable0
|
|
jcgo_jniNoNativeFunc();
|
|
return (jint)0;
|
|
#else
|
|
jint jcgo_retval;
|
|
JCGO_JNI_BLOCK(0)
|
|
jcgo_retval= JCGO_JNI_FUNC(Java_gnu_java_net_VMPlainSocketImpl_socketAvailable0)(jcgo_pJniEnv,
|
|
(jclass)JCGO_JNI_TOLOCALREF(0, JCGO_CLASSREF_OF(gnu_java_net_VMPlainSocketImpl__class)),
|
|
fd);
|
|
jcgo_jniLeave(jcgo_pJniEnv, NULL);
|
|
return jcgo_retval;
|
|
#endif
|
|
}
|
|
|
|
JCGO_NOSEP_INLINE jint CFASTCALL
|
|
gnu_java_net_VMPlainSocketImpl__socketRecvFrom0__IBAIIIIBAIIA( jbyteArr
|
|
buffer, jbyteArr ip, jintArr iplenPortArr, jint fd, jint off, jint
|
|
len, jint urgent, jint peek, jint ipmaxlen )
|
|
{
|
|
#ifdef NOJAVA_gnu_java_net_VMPlainSocketImpl_socketRecvFrom0
|
|
jcgo_jniNoNativeFunc();
|
|
return (jint)0;
|
|
#else
|
|
jint jcgo_retval;
|
|
JCGO_JNI_BLOCK(3)
|
|
jcgo_retval= JCGO_JNI_FUNC(Java_gnu_java_net_VMPlainSocketImpl_socketRecvFrom0)(jcgo_pJniEnv,
|
|
(jclass)JCGO_JNI_TOLOCALREF(0, JCGO_CLASSREF_OF(gnu_java_net_VMPlainSocketImpl__class)),
|
|
fd, (jbyteArray)JCGO_JNI_TOLOCALREF(1, buffer), off, len, urgent,
|
|
peek, (jbyteArray)JCGO_JNI_TOLOCALREF(2, ip), ipmaxlen, (jintArray)JCGO_JNI_TOLOCALREF(3,
|
|
iplenPortArr));
|
|
jcgo_jniLeave(jcgo_pJniEnv, NULL);
|
|
return jcgo_retval;
|
|
#endif
|
|
}
|
|
|
|
JCGO_NOSEP_INLINE jint CFASTCALL
|
|
gnu_java_net_VMPlainSocketImpl__socketSendTo0__IBAIIIBAII( jbyteArr
|
|
buffer, jbyteArr ip, jint fd, jint off, jint len, jint urgent, jint
|
|
iplen, jint port )
|
|
{
|
|
#ifdef NOJAVA_gnu_java_net_VMPlainSocketImpl_socketSendTo0
|
|
jcgo_jniNoNativeFunc();
|
|
return (jint)0;
|
|
#else
|
|
jint jcgo_retval;
|
|
JCGO_JNI_BLOCK(2)
|
|
jcgo_retval= JCGO_JNI_FUNC(Java_gnu_java_net_VMPlainSocketImpl_socketSendTo0)(jcgo_pJniEnv,
|
|
(jclass)JCGO_JNI_TOLOCALREF(0, JCGO_CLASSREF_OF(gnu_java_net_VMPlainSocketImpl__class)),
|
|
fd, (jbyteArray)JCGO_JNI_TOLOCALREF(1, buffer), off, len, urgent,
|
|
(jbyteArray)JCGO_JNI_TOLOCALREF(2, ip), iplen, port);
|
|
jcgo_jniLeave(jcgo_pJniEnv, NULL);
|
|
return jcgo_retval;
|
|
#endif
|
|
}
|
|
|
|
JCGO_NOSEP_STATIC gnu_java_net_VMPlainSocketImpl CFASTCALL
|
|
gnu_java_net_VMPlainSocketImpl__this__( gnu_java_net_VMPlainSocketImpl
|
|
This )
|
|
{
|
|
{
|
|
;
|
|
gnu_java_net_VMPlainSocketImpl__void(This);
|
|
}
|
|
return This;
|
|
}
|
|
|
|
JCGO_NOSEP_INLINE gnu_java_net_VMPlainSocketImpl CFASTCALL
|
|
gnu_java_net_VMPlainSocketImpl__new__( void )
|
|
{
|
|
return gnu_java_net_VMPlainSocketImpl__this__(
|
|
(gnu_java_net_VMPlainSocketImpl)jcgo_newObject((jvtable)&gnu_java_net_VMPlainSocketImpl_methods));
|
|
}
|
|
|
|
JCGO_NOSEP_INLINE gnu_java_net_VMPlainSocketImpl_State CFASTCALL
|
|
gnu_java_net_VMPlainSocketImpl__getState__( gnu_java_net_VMPlainSocketImpl
|
|
This )
|
|
{
|
|
{
|
|
return JCGO_FIELD_NZACCESS(This, state);
|
|
}
|
|
}
|
|
|
|
JCGO_NOSEP_STATIC void CFASTCALL
|
|
gnu_java_net_VMPlainSocketImpl__setOption__ILo( gnu_java_net_VMPlainSocketImpl
|
|
This, java_lang_Object value, jint optionId )
|
|
{
|
|
{
|
|
jint optval;
|
|
jint res;
|
|
optval= (-(jint)1);
|
|
if (jcgo_instanceOf0(OBJT_java_lang_Integer, MAXT_java_lang_Integer,
|
|
(jObject)value))
|
|
{
|
|
if (optionId == java_net_SocketOptions__SO_TIMEOUT)
|
|
{
|
|
jint jcgo_rcvrI1;
|
|
(jcgo_rcvrI1= (gnu_java_net_VMPlainSocketImpl__getNativeSocketFD__(
|
|
This)), gnu_java_net_VMPlainSocketImpl__setTimeoutFor__II(
|
|
jcgo_rcvrI1, (java_lang_Integer__intValue__(
|
|
((java_lang_Integer)value)))));
|
|
return;
|
|
}
|
|
if (optionId == java_net_SocketOptions__SO_LINGER0 || optionId ==
|
|
java_net_SocketOptions__SO_SNDBUF0 || optionId == java_net_SocketOptions__SO_RCVBUF0 ||
|
|
optionId == java_net_SocketOptions__IP_TOS0)
|
|
{
|
|
optval= (java_lang_Integer__intValue__(
|
|
((java_lang_Integer)value)));
|
|
if (optval < 0)
|
|
{
|
|
optval= 0;
|
|
}
|
|
else
|
|
{
|
|
if (optionId == java_net_SocketOptions__SO_LINGER0)
|
|
{
|
|
optval++;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if (jcgo_instanceOf0(OBJT_java_lang_Boolean, MAXT_java_lang_Boolean,
|
|
(jObject)value))
|
|
{
|
|
if (optionId != java_net_SocketOptions__SO_TIMEOUT && optionId !=
|
|
java_net_SocketOptions__SO_SNDBUF0 && optionId != java_net_SocketOptions__SO_RCVBUF0 &&
|
|
optionId != java_net_SocketOptions__IP_TOS0)
|
|
{
|
|
optval= 0;
|
|
if ((java_lang_Boolean__booleanValue__(
|
|
((java_lang_Boolean)value))))
|
|
{
|
|
optval= (jint)1;
|
|
if (optionId == java_net_SocketOptions__SO_LINGER0)
|
|
{
|
|
optval= (-(jint)1);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if (value == jnull)
|
|
{
|
|
JCGO_THROW_EXC(java_lang_NullPointerException__new__());
|
|
}
|
|
}
|
|
}
|
|
if (optval < 0)
|
|
{
|
|
JCGO_THROW_EXC((java_lang_IllegalArgumentException__new__Ls(
|
|
JCGO_STRREF_OF(jcgo_string4_VMPlScIm))));
|
|
}
|
|
;
|
|
do
|
|
{
|
|
res= (gnu_java_net_VMPlainSocketImpl__socketGetSetOption0__III(
|
|
(gnu_java_net_VMPlainSocketImpl__getNativeSocketFD__(
|
|
This)), optionId, optval));
|
|
}
|
|
while (res < 0 && (gnu_java_net_VMPlainSocketImpl__isSocketErrInterrupted0__I(
|
|
res)) != 0);
|
|
(gnu_java_net_VMPlainSocketImpl__checkSocketResCode__I(
|
|
res));
|
|
}
|
|
}
|
|
|
|
JCGO_NOSEP_INLINE void CFASTCALL
|
|
gnu_java_net_VMPlainSocketImpl__bind__L5zjct( gnu_java_net_VMPlainSocketImpl
|
|
This, java_net_InetSocketAddress address )
|
|
{
|
|
{
|
|
java_net_InetAddress addr;
|
|
jint fd;
|
|
addr= (JCGO_CALL_FINALF(address) java_net_InetSocketAddress__getAddress__(
|
|
address));
|
|
fd= (gnu_java_net_VMPlainSocketImpl_State__getNativeFD__(
|
|
JCGO_FIELD_NZACCESS(This, state)));
|
|
if (addr == jnull)
|
|
{
|
|
JCGO_THROW_EXC((java_net_SocketException__new__Ls(
|
|
java_lang_VMSystem__concat0X__LsLs(
|
|
JCGO_STRREF_OF(jcgo_string5_VMPlScIm), (java_net_InetSocketAddress__toString__(
|
|
address))))));
|
|
}
|
|
(gnu_java_net_VMPlainSocketImpl__socketBind__IL7lnuwI(
|
|
addr, fd, (java_net_InetSocketAddress__getPort__(
|
|
address))));
|
|
}
|
|
}
|
|
|
|
JCGO_NOSEP_INLINE void CFASTCALL
|
|
gnu_java_net_VMPlainSocketImpl__close__( gnu_java_net_VMPlainSocketImpl
|
|
This )
|
|
{
|
|
{
|
|
(gnu_java_net_VMPlainSocketImpl_State__close__(
|
|
JCGO_FIELD_NZACCESS(This, state)));
|
|
}
|
|
}
|
|
|
|
JCGO_NOSEP_STATIC void CFASTCALL
|
|
gnu_java_net_VMPlainSocketImpl__socketsInit__( void )
|
|
{
|
|
{
|
|
if (!gnu_java_net_VMPlainSocketImpl__initialized)
|
|
{
|
|
{
|
|
JCGO_SYNC_BLOCKSAFENZ(gnu_java_net_VMPlainSocketImpl__EMPTY_FDS)
|
|
{
|
|
if (!gnu_java_net_VMPlainSocketImpl__initialized)
|
|
{
|
|
if ((gnu_java_net_VMPlainSocketImpl__socketsInit0__()) < 0)
|
|
{
|
|
JCGO_THROW_EXC((java_lang_InternalError__new__Ls(
|
|
JCGO_STRREF_OF(jcgo_string6_VMPlScIm))));
|
|
}
|
|
gnu_java_net_VMPlainSocketImpl__preventBlocking= (jboolean)(java_lang_VMAccessorJavaLang__preventIOBlockingVMRuntime__());
|
|
gnu_java_net_VMPlainSocketImpl__initialized= (jboolean)jtrue;
|
|
}
|
|
}
|
|
JCGO_SYNC_END
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
JCGO_NOSEP_FRWINL jint CFASTCALL
|
|
gnu_java_net_VMPlainSocketImpl__socketCreate__Z( jboolean stream )
|
|
{
|
|
{
|
|
jintArr resArr;
|
|
jint fd;
|
|
jint res;
|
|
jint optionId;
|
|
jboolean retrying;
|
|
(gnu_java_net_VMPlainSocketImpl__socketsInit__());
|
|
res= 0;
|
|
resArr= (jintArr)jcgo_newArray(JCGO_CORECLASS_FOR(OBJT_jint), 0,
|
|
(jint)1);
|
|
retrying= jfalse;
|
|
do
|
|
{
|
|
fd= (gnu_java_net_VMPlainSocketImpl__socketCreate0__IAI(
|
|
resArr, stream? (jint)1 : 0));
|
|
if (fd != (-(jint)1))
|
|
{
|
|
break;
|
|
}
|
|
res= JCGO_ARRAY_NZIACCESS(resArr, 0);
|
|
if (!retrying && (gnu_java_net_VMPlainSocketImpl__isSocketRetryNeededOnce__I(
|
|
res)))
|
|
{
|
|
retrying= (jboolean)jtrue;
|
|
}
|
|
else
|
|
{
|
|
if ((gnu_java_net_VMPlainSocketImpl__isSocketErrInterrupted0__I(
|
|
res)) == 0)
|
|
{
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
while (jtrue);
|
|
(gnu_java_net_VMPlainSocketImpl__checkSocketResCode__I(
|
|
res));
|
|
(gnu_java_net_VMPlainSocketImpl__setTimeoutFor__II(
|
|
fd, 0));
|
|
if (gnu_java_net_VMPlainSocketImpl__preventBlocking)
|
|
{
|
|
(gnu_java_net_VMPlainSocketImpl__socketSetNonBlocking0__II(
|
|
fd, (jint)1));
|
|
}
|
|
optionId= stream? java_net_SocketOptions__SO_REUSEADDR0 : java_net_SocketOptions__SO_BROADCAST0;
|
|
do
|
|
{
|
|
res= (gnu_java_net_VMPlainSocketImpl__socketGetSetOption0__III(
|
|
fd, optionId, (jint)1));
|
|
}
|
|
while (res < 0 && (gnu_java_net_VMPlainSocketImpl__isSocketErrInterrupted0__I(
|
|
res)) != 0);
|
|
return fd;
|
|
}
|
|
}
|
|
|
|
JCGO_NOSEP_FRWINL java_net_InetSocketAddress CFASTCALL
|
|
gnu_java_net_VMPlainSocketImpl__socketGetLocalAddrPort__I( jint fd
|
|
)
|
|
{
|
|
{
|
|
jbyteArr ip;
|
|
jintArr portArr;
|
|
jint res;
|
|
jObject jcgo_rcvrL1;
|
|
ip= (jbyteArr)jcgo_newArray(JCGO_CORECLASS_FOR(OBJT_jbyte), 0, gnu_java_net_VMPlainSocketImpl__MAX_IP_SIZE);
|
|
portArr= (jintArr)jcgo_newArray(JCGO_CORECLASS_FOR(OBJT_jint), 0,
|
|
(jint)1);
|
|
do
|
|
{
|
|
res= (gnu_java_net_VMPlainSocketImpl__socketGetLocalAddrPort0__IBAIIA(
|
|
ip, portArr, fd, JCGO_ARRAY_NZLENGTH(ip)));
|
|
}
|
|
while (res < 0 && (gnu_java_net_VMPlainSocketImpl__isSocketErrInterrupted0__I(
|
|
res)) != 0);
|
|
(gnu_java_net_VMPlainSocketImpl__checkSocketResCode__I(
|
|
res));
|
|
return (jcgo_rcvrL1= (jObject)(gnu_java_net_VMPlainSocketImpl__toInetAddress__BAI(
|
|
ip, res)), java_net_InetSocketAddress__new__L7lnuwI(
|
|
(java_net_InetAddress)jcgo_rcvrL1, JCGO_ARRAY_NZIACCESS(portArr,
|
|
0)));
|
|
}
|
|
}
|
|
|
|
JCGO_NOSEP_FRWINL void CFASTCALL
|
|
gnu_java_net_VMPlainSocketImpl__socketSetNonBlocking__IZ( jint fd,
|
|
jboolean on )
|
|
{
|
|
{
|
|
if (!gnu_java_net_VMPlainSocketImpl__preventBlocking)
|
|
{
|
|
(gnu_java_net_VMPlainSocketImpl__checkIOSockResCode__I(
|
|
(gnu_java_net_VMPlainSocketImpl__socketSetNonBlocking0__II(
|
|
fd, on? (jint)1 : 0))));
|
|
}
|
|
}
|
|
}
|
|
|
|
JCGO_NOSEP_FRWINL jint CFASTCALL
|
|
gnu_java_net_VMPlainSocketImpl__socketAvailable__I( jint fd )
|
|
{
|
|
{
|
|
jint res;
|
|
res= (gnu_java_net_VMPlainSocketImpl__socketAvailable0__I(
|
|
fd));
|
|
if (res <= 0)
|
|
{
|
|
jintArr readFDs;
|
|
readFDs= (jintArr)jcgo_newArray(JCGO_CORECLASS_FOR(OBJT_jint), 0,
|
|
(jint)1);
|
|
do
|
|
{
|
|
res= 0;
|
|
if ((JCGO_ARRAY_NZIACCESS(readFDs, 0)= fd) == (-(jint)1))
|
|
{
|
|
break;
|
|
}
|
|
res= (gnu_java_net_VMPlainSocketImpl__socketSelect0__IAIIAIIAII(
|
|
readFDs, gnu_java_net_VMPlainSocketImpl__EMPTY_FDS, gnu_java_net_VMPlainSocketImpl__EMPTY_FDS,
|
|
(jint)1, 0, 0, 0));
|
|
}
|
|
while (res < 0 && (gnu_java_net_VMPlainSocketImpl__isSocketErrInterrupted0__I(
|
|
res)) != 0);
|
|
(gnu_java_net_VMPlainSocketImpl__checkIOSockResCode__I(
|
|
res));
|
|
if (res > 0)
|
|
{
|
|
res= (jint)1;
|
|
}
|
|
}
|
|
return res;
|
|
}
|
|
}
|
|
|
|
JCGO_NOSEP_STATIC jboolean CFASTCALL
|
|
gnu_java_net_VMPlainSocketImpl__socketConnect__IL5zjctI( java_net_InetSocketAddress
|
|
address, jint fd, jint timeout )
|
|
{
|
|
{
|
|
java_net_InetAddress addr;
|
|
jbyteArr ip;
|
|
jint port;
|
|
JCGO_TRY_VOLATILE jint res;
|
|
JCGO_TRY_VOLATILE jboolean isConnected;
|
|
JCGO_TRY_VOLATILE jboolean retrying;
|
|
addr= (JCGO_CALL_FINALF(address) java_net_InetSocketAddress__getAddress__(
|
|
address));
|
|
if (addr == jnull)
|
|
{
|
|
JCGO_THROW_EXC((java_net_SocketException__new__Ls(
|
|
java_lang_VMSystem__concat0X__LsLs(
|
|
JCGO_STRREF_OF(jcgo_string5_VMPlScIm), (java_net_InetSocketAddress__toString__(
|
|
address))))));
|
|
}
|
|
port= (java_net_InetSocketAddress__getPort__(
|
|
address));
|
|
ip= (JCGO_CALL_NZVFUNC(addr)->getAddress__(
|
|
addr));
|
|
if (timeout < 0 && gnu_java_net_VMPlainSocketImpl__preventBlocking)
|
|
{
|
|
timeout= gnu_java_net_VMPlainSocketImpl__DEFAULT_TIMEOUT;
|
|
}
|
|
if (timeout != 0)
|
|
{
|
|
(gnu_java_net_VMPlainSocketImpl__checkThreadInterrupted__());
|
|
}
|
|
;
|
|
isConnected= jtrue;
|
|
retrying= jfalse;
|
|
if (timeout >= 0)
|
|
{
|
|
jlong deadline;
|
|
JCGO_TRY_VOLATILE jboolean connecting;
|
|
deadline= timeout > 0? (gnu_java_net_VMPlainSocketImpl__getDeadlineTime__I(
|
|
timeout)) : JLONG_C(0);
|
|
connecting= jfalse;
|
|
{
|
|
JCGO_TRY_BLOCK
|
|
{
|
|
if (timeout > 0 && !gnu_java_net_VMPlainSocketImpl__preventBlocking)
|
|
{
|
|
(gnu_java_net_VMPlainSocketImpl__socketSetNonBlocking0__II(
|
|
fd, (jint)1));
|
|
}
|
|
do
|
|
{
|
|
jboolean oldConnecting;
|
|
oldConnecting= connecting;
|
|
res= (gnu_java_net_VMPlainSocketImpl__socketConnect0__IBAII(
|
|
ip, fd, JCGO_ARRAY_LENGTH(ip), port));
|
|
connecting= (jboolean)jtrue;
|
|
if (!retrying && (gnu_java_net_VMPlainSocketImpl__isSocketRetryNeededOnce__I(
|
|
res)))
|
|
{
|
|
connecting= (jboolean)oldConnecting;
|
|
retrying= (jboolean)jtrue;
|
|
}
|
|
else
|
|
{
|
|
if (res >= 0)
|
|
{
|
|
break;
|
|
}
|
|
if (timeout == 0)
|
|
{
|
|
if ((gnu_java_net_VMPlainSocketImpl__isSocketErrConnected0__I(
|
|
res)) == 0)
|
|
{
|
|
if ((gnu_java_net_VMPlainSocketImpl__isSocketErrInterrupted0__I(
|
|
res)) == 0 && (gnu_java_net_VMPlainSocketImpl__isSocketErrConnInProgress0__I(
|
|
res)) == 0)
|
|
{
|
|
break;
|
|
}
|
|
isConnected= (jboolean)jfalse;
|
|
}
|
|
res= 0;
|
|
break;
|
|
}
|
|
if ((gnu_java_net_VMPlainSocketImpl__isSocketErrConnInProgress0__I(
|
|
res)) != 0)
|
|
{
|
|
if (!oldConnecting)
|
|
{
|
|
(gnu_java_net_VMPlainSocketImpl__socketSelectSingle__IZZZJZ(
|
|
deadline, fd, (jboolean)jtrue, (jboolean)jtrue, (jboolean)jfalse,
|
|
(jboolean)jfalse));
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if (oldConnecting && (gnu_java_net_VMPlainSocketImpl__isSocketErrConnected0__I(
|
|
res)) != 0)
|
|
{
|
|
res= 0;
|
|
break;
|
|
}
|
|
connecting= (jboolean)oldConnecting;
|
|
if ((gnu_java_net_VMPlainSocketImpl__isSocketErrInterrupted0__I(
|
|
res)) == 0)
|
|
{
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
(java_lang_Thread__yield__());
|
|
if (timeout > 0)
|
|
{
|
|
if ((gnu_java_net_VMPlainSocketImpl__getTimeoutOfDeadline__J(
|
|
deadline)) <= 0)
|
|
{
|
|
JCGO_THROW_EXC(java_net_SocketTimeoutException__new__());
|
|
}
|
|
(gnu_java_net_VMPlainSocketImpl__checkThreadInterrupted__());
|
|
}
|
|
}
|
|
while (jtrue);
|
|
if (res >= 0)
|
|
{
|
|
connecting= (jboolean)jfalse;
|
|
}
|
|
}
|
|
JCGO_TRY_LEAVE
|
|
{
|
|
if (timeout > 0 && !gnu_java_net_VMPlainSocketImpl__preventBlocking)
|
|
{
|
|
(gnu_java_net_VMPlainSocketImpl__socketSetNonBlocking0__II(
|
|
fd, 0));
|
|
}
|
|
if (connecting)
|
|
{
|
|
(gnu_java_net_VMPlainSocketImpl__socketShutdown__IZZ(
|
|
fd, (jboolean)jtrue, (jboolean)jtrue));
|
|
}
|
|
}
|
|
JCGO_TRY_FINALLYEND
|
|
}
|
|
}
|
|
else
|
|
{
|
|
do
|
|
{
|
|
res= (gnu_java_net_VMPlainSocketImpl__socketConnect0__IBAII(
|
|
ip, fd, JCGO_ARRAY_LENGTH(ip), port));
|
|
if (!retrying && (gnu_java_net_VMPlainSocketImpl__isSocketRetryNeededOnce__I(
|
|
res)))
|
|
{
|
|
retrying= (jboolean)jtrue;
|
|
}
|
|
else
|
|
{
|
|
if (res >= 0 || (gnu_java_net_VMPlainSocketImpl__isSocketErrInterrupted0__I(
|
|
res)) == 0)
|
|
{
|
|
break;
|
|
}
|
|
}
|
|
(java_lang_Thread__yield__());
|
|
(gnu_java_net_VMPlainSocketImpl__checkThreadInterrupted__());
|
|
}
|
|
while (jtrue);
|
|
}
|
|
if (res < 0)
|
|
{
|
|
java_lang_String message;
|
|
if ((gnu_java_net_VMPlainSocketImpl__isSocketErrAddrNotAvail0__I(
|
|
res)) != 0)
|
|
{
|
|
JCGO_THROW_EXC((java_net_ConnectException__new__Ls(
|
|
JCGO_STRREF_OF(jcgo_string7_VMPlScIm))));
|
|
}
|
|
message= (gnu_java_net_VMPlainSocketImpl__getSocketErrorMsg0__I(
|
|
res));
|
|
if ((gnu_java_net_VMPlainSocketImpl__isSocketErrConnRefused0__I(
|
|
res)) != 0)
|
|
{
|
|
JCGO_THROW_EXC((java_net_ConnectException__new__Ls(
|
|
message)));
|
|
}
|
|
if ((gnu_java_net_VMPlainSocketImpl__isSocketErrHostUnreach0__I(
|
|
res)) != 0)
|
|
{
|
|
JCGO_THROW_EXC((java_net_NoRouteToHostException__new__Ls(
|
|
message)));
|
|
}
|
|
JCGO_THROW_EXC((java_net_SocketException__new__Ls(
|
|
message)));
|
|
}
|
|
return (jboolean)isConnected;
|
|
}
|
|
}
|
|
|
|
JCGO_NOSEP_FRWINL java_net_InetSocketAddress CFASTCALL
|
|
gnu_java_net_VMPlainSocketImpl__socketRecvFrom__IBAIAIZZZZZ( jbyteArr
|
|
buffer, jintArr offArr, jint fd, jint len, jboolean urgent, jboolean
|
|
peek, jboolean fillAddress, jboolean stream, jboolean isNonBlocking
|
|
)
|
|
{
|
|
{
|
|
jbyteArr ip;
|
|
jintArr iplenPortArr;
|
|
jbyteArr origBuffer;
|
|
jlong deadline;
|
|
jint off;
|
|
jint timeout;
|
|
jObject jcgo_rcvrL1;
|
|
off= JCGO_ARRAY_IACCESS(offArr, 0);
|
|
if ((off | len) < 0 || JCGO_ARRAY_LENGTH(buffer) - off < len)
|
|
{
|
|
JCGO_THROW_EXC(java_lang_ArrayIndexOutOfBoundsException__new__());
|
|
}
|
|
ip= gnu_java_net_VMPlainSocketImpl__EMPTY_BUF;
|
|
if (fillAddress)
|
|
{
|
|
ip= (jbyteArr)jcgo_newArray(JCGO_CORECLASS_FOR(OBJT_jbyte), 0, gnu_java_net_VMPlainSocketImpl__MAX_IP_SIZE);
|
|
stream= (jboolean)jtrue;
|
|
}
|
|
iplenPortArr= (jintArr)jcgo_newArray(JCGO_CORECLASS_FOR(OBJT_jint),
|
|
0, (jint)2);
|
|
origBuffer= buffer;
|
|
timeout= 0;
|
|
deadline= JLONG_C(0);
|
|
if (!isNonBlocking)
|
|
{
|
|
timeout= (gnu_java_net_VMPlainSocketImpl__getTimeoutFor__I(
|
|
fd));
|
|
if (timeout == 0 && gnu_java_net_VMPlainSocketImpl__preventBlocking)
|
|
{
|
|
timeout= gnu_java_net_VMPlainSocketImpl__DEFAULT_TIMEOUT;
|
|
}
|
|
deadline= (gnu_java_net_VMPlainSocketImpl__socketSelectSingle__IZZZJZ(
|
|
(jlong)timeout, fd, (jboolean)(!urgent), (jboolean)jfalse, (jboolean)urgent,
|
|
(jboolean)jtrue));
|
|
}
|
|
do
|
|
{
|
|
jint res;
|
|
res= (gnu_java_net_VMPlainSocketImpl__socketRecvFrom0__IBAIIIIBAIIA(
|
|
buffer, ip, iplenPortArr, fd, off, len, urgent? (jint)1 : 0, peek?
|
|
(jint)1 : 0, stream? JCGO_ARRAY_NZLENGTH(ip) : (-(jint)1)));
|
|
if (res > 0)
|
|
{
|
|
if (res >= len)
|
|
{
|
|
res= len;
|
|
}
|
|
if (buffer != origBuffer)
|
|
{
|
|
off= JCGO_ARRAY_NZIACCESS(offArr, 0);
|
|
(java_lang_System__arraycopy__LoILoII(
|
|
(java_lang_Object)buffer, (java_lang_Object)origBuffer, 0, off,
|
|
res));
|
|
}
|
|
JCGO_ARRAY_NZIACCESS(offArr, 0)= (off + res);
|
|
break;
|
|
}
|
|
if (res == 0)
|
|
{
|
|
if (!fillAddress)
|
|
{
|
|
(JCGO_ARRAY_NZIACCESS(offArr, 0))--;
|
|
break;
|
|
}
|
|
if (off == 0)
|
|
{
|
|
break;
|
|
}
|
|
buffer= (jbyteArr)jcgo_newArray(JCGO_CORECLASS_FOR(OBJT_jbyte),
|
|
0, len);
|
|
off= 0;
|
|
}
|
|
else
|
|
{
|
|
if ((gnu_java_net_VMPlainSocketImpl__isSocketErrInterrupted0__I(
|
|
res)) == 0)
|
|
{
|
|
(gnu_java_net_VMPlainSocketImpl__checkIOSockResCode__I(
|
|
res));
|
|
}
|
|
if (isNonBlocking)
|
|
{
|
|
fillAddress= (jboolean)jfalse;
|
|
break;
|
|
}
|
|
}
|
|
(java_lang_Thread__yield__());
|
|
if (!isNonBlocking)
|
|
{
|
|
if (timeout > 0 && (gnu_java_net_VMPlainSocketImpl__getTimeoutOfDeadline__J(
|
|
deadline)) <= 0)
|
|
{
|
|
JCGO_THROW_EXC(java_net_SocketTimeoutException__new__());
|
|
}
|
|
(gnu_java_net_VMPlainSocketImpl__checkThreadInterrupted__());
|
|
}
|
|
}
|
|
while (jtrue);
|
|
return fillAddress? (jcgo_rcvrL1= (jObject)(gnu_java_net_VMPlainSocketImpl__toInetAddress__BAI(
|
|
ip, JCGO_ARRAY_NZIACCESS(iplenPortArr, 0))), java_net_InetSocketAddress__new__L7lnuwI(
|
|
(java_net_InetAddress)jcgo_rcvrL1, JCGO_ARRAY_NZIACCESS(iplenPortArr,
|
|
(jint)1))) : jnull;
|
|
}
|
|
}
|
|
|
|
JCGO_NOSEP_FRWINL void CFASTCALL
|
|
gnu_java_net_VMPlainSocketImpl__socketSendTo__IBAIAIL5zjctZZ( jbyteArr
|
|
buffer, jintArr offArr, java_net_InetSocketAddress address, jint fd,
|
|
jint len, jboolean urgent, jboolean isNonBlocking )
|
|
{
|
|
{
|
|
jbyteArr ip;
|
|
jlong deadline;
|
|
jint off;
|
|
jint port;
|
|
jint remain;
|
|
jint timeout;
|
|
off= JCGO_ARRAY_IACCESS(offArr, 0);
|
|
if ((off | len) < 0 || JCGO_ARRAY_LENGTH(buffer) - off < len)
|
|
{
|
|
JCGO_THROW_EXC(java_lang_ArrayIndexOutOfBoundsException__new__());
|
|
}
|
|
ip= gnu_java_net_VMPlainSocketImpl__EMPTY_BUF;
|
|
port= 0;
|
|
if (address != jnull)
|
|
{
|
|
java_net_InetAddress addr;
|
|
addr= (java_net_InetSocketAddress__getAddress__(
|
|
address));
|
|
if (addr == jnull)
|
|
{
|
|
JCGO_THROW_EXC((java_net_SocketException__new__Ls(
|
|
java_lang_VMSystem__concat0X__LsLs(
|
|
JCGO_STRREF_OF(jcgo_string5_VMPlScIm), (java_net_InetSocketAddress__toString__(
|
|
address))))));
|
|
}
|
|
ip= (JCGO_CALL_NZVFUNC(addr)->getAddress__(
|
|
addr));
|
|
port= (java_net_InetSocketAddress__getPort__(
|
|
address));
|
|
}
|
|
remain= len;
|
|
timeout= 0;
|
|
deadline= JLONG_C(0);
|
|
if (!isNonBlocking)
|
|
{
|
|
timeout= (gnu_java_net_VMPlainSocketImpl__getTimeoutFor__I(
|
|
fd));
|
|
if (timeout == 0 && gnu_java_net_VMPlainSocketImpl__preventBlocking)
|
|
{
|
|
timeout= gnu_java_net_VMPlainSocketImpl__DEFAULT_TIMEOUT;
|
|
}
|
|
deadline= (gnu_java_net_VMPlainSocketImpl__socketSelectSingle__IZZZJZ(
|
|
(jlong)timeout, fd, (jboolean)jfalse, (jboolean)jtrue, (jboolean)jfalse,
|
|
(jboolean)jtrue));
|
|
}
|
|
do
|
|
{
|
|
jint res;
|
|
res= (gnu_java_net_VMPlainSocketImpl__socketSendTo0__IBAIIIBAII(
|
|
buffer, ip, fd, off, remain, urgent? (jint)1 : 0, JCGO_ARRAY_LENGTH(ip),
|
|
port));
|
|
if (res >= 0)
|
|
{
|
|
JCGO_ARRAY_NZIACCESS(offArr, 0)+= res;
|
|
if ((remain-= res) <= 0)
|
|
{
|
|
break;
|
|
}
|
|
if (res == 0 && off > 0)
|
|
{
|
|
jbyteArr newBuffer;
|
|
newBuffer= (jbyteArr)jcgo_newArray(JCGO_CORECLASS_FOR(OBJT_jbyte),
|
|
0, remain);
|
|
(java_lang_System__arraycopy__LoILoII(
|
|
(java_lang_Object)buffer, (java_lang_Object)newBuffer, off, 0,
|
|
remain));
|
|
buffer= newBuffer;
|
|
off= 0;
|
|
}
|
|
else
|
|
{
|
|
if (address != jnull)
|
|
{
|
|
break;
|
|
}
|
|
off+= res;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if ((gnu_java_net_VMPlainSocketImpl__isSocketErrInterrupted0__I(
|
|
res)) == 0)
|
|
{
|
|
(gnu_java_net_VMPlainSocketImpl__checkIOSockResCode__I(
|
|
res));
|
|
}
|
|
if (isNonBlocking)
|
|
{
|
|
break;
|
|
}
|
|
}
|
|
(java_lang_Thread__yield__());
|
|
if (!isNonBlocking)
|
|
{
|
|
if (res > 0)
|
|
{
|
|
deadline= (gnu_java_net_VMPlainSocketImpl__socketSelectSingle__IZZZJZ(
|
|
(jlong)timeout, fd, (jboolean)jfalse, (jboolean)jtrue, (jboolean)jfalse,
|
|
(jboolean)jtrue));
|
|
}
|
|
else
|
|
{
|
|
if (timeout > 0 && (gnu_java_net_VMPlainSocketImpl__getTimeoutOfDeadline__J(
|
|
deadline)) <= 0)
|
|
{
|
|
JCGO_THROW_EXC(java_net_SocketTimeoutException__new__());
|
|
}
|
|
if (remain == len)
|
|
{
|
|
(gnu_java_net_VMPlainSocketImpl__checkThreadInterrupted__());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
while (jtrue);
|
|
}
|
|
}
|
|
|
|
JCGO_NOSEP_STATIC void CFASTCALL
|
|
gnu_java_net_VMPlainSocketImpl__socketClose__I( jint fd )
|
|
{
|
|
{
|
|
jint res;
|
|
do
|
|
{
|
|
res= (gnu_java_net_VMPlainSocketImpl__socketClose0__I(
|
|
fd));
|
|
}
|
|
while (res < 0 && (gnu_java_net_VMPlainSocketImpl__isSocketErrInterrupted0__I(
|
|
res)) != 0);
|
|
(gnu_java_net_VMPlainSocketImpl__checkIOSockResCode__I(
|
|
res));
|
|
(gnu_java_net_VMPlainSocketImpl__setTimeoutFor__II(
|
|
fd, 0));
|
|
}
|
|
}
|
|
|
|
JCGO_NOSEP_STATIC jint CFASTCALL
|
|
gnu_java_net_VMPlainSocketImpl__getNativeSocketFD__( gnu_java_net_VMPlainSocketImpl
|
|
This )
|
|
{
|
|
{
|
|
{
|
|
JCGO_TRY_BLOCK
|
|
{
|
|
{
|
|
jint jcgo_retval= (gnu_java_net_VMPlainSocketImpl_State__getNativeFD__(
|
|
JCGO_FIELD_NZACCESS(This, state)));
|
|
#ifndef JCGO_SEHTRY
|
|
jcgo_tryLeave();
|
|
#endif
|
|
return jcgo_retval;
|
|
}
|
|
}
|
|
JCGO_TRY_LEAVE
|
|
JCGO_TRY_CATCHES(1)
|
|
JCGO_TRY_CATCH(OBJT_java_net_SocketException, MAXT_java_net_SocketException)
|
|
{
|
|
java_net_SocketException e;
|
|
e= (java_net_SocketException)JCGO_TRY_THROWABLE(0);
|
|
JCGO_THROW_EXC(e);
|
|
}
|
|
JCGO_TRY_CATCH(OBJT_java_io_IOException, MAXT_java_io_IOException)
|
|
{
|
|
java_io_IOException e;
|
|
e= (java_io_IOException)JCGO_TRY_THROWABLE(0);
|
|
JCGO_THROW_EXC((java_net_SocketException)JCGO_CAST_OBJECT0(OBJT_java_net_SocketException,
|
|
MAXT_java_net_SocketException, (java_lang_Throwable__initCause__Lt(
|
|
(java_lang_Throwable)java_net_SocketException__new__(), (java_lang_Throwable)e))));
|
|
}
|
|
JCGO_TRY_RETHROW(1)
|
|
}
|
|
}
|
|
return (jint)0;
|
|
}
|
|
|
|
JCGO_NOSEP_STATIC jlong CFASTCALL
|
|
gnu_java_net_VMPlainSocketImpl__socketSelectSingle__IZZZJZ( jlong
|
|
deadline, jint fd, jboolean input, jboolean output, jboolean urgent,
|
|
jboolean isTimeout )
|
|
{
|
|
{
|
|
jint timeout;
|
|
timeout= 0;
|
|
if (isTimeout)
|
|
{
|
|
(gnu_java_net_VMPlainSocketImpl__checkThreadInterrupted__());
|
|
timeout= (jint)deadline;
|
|
if (timeout <= 0)
|
|
{
|
|
return JLONG_C(0);
|
|
}
|
|
deadline= (gnu_java_net_VMPlainSocketImpl__getDeadlineTime__I(
|
|
timeout));
|
|
}
|
|
if (fd != (-(jint)1))
|
|
{
|
|
jintArr readFDs;
|
|
jintArr writeFDs;
|
|
jintArr exceptFDs;
|
|
jint res;
|
|
readFDs= input? (jintArr)jcgo_newArray(JCGO_CORECLASS_FOR(OBJT_jint),
|
|
0, (jint)1) : gnu_java_net_VMPlainSocketImpl__EMPTY_FDS;
|
|
writeFDs= output? (jintArr)jcgo_newArray(JCGO_CORECLASS_FOR(OBJT_jint),
|
|
0, (jint)1) : gnu_java_net_VMPlainSocketImpl__EMPTY_FDS;
|
|
exceptFDs= urgent? (jintArr)jcgo_newArray(JCGO_CORECLASS_FOR(OBJT_jint),
|
|
0, (jint)1) : gnu_java_net_VMPlainSocketImpl__EMPTY_FDS;
|
|
do
|
|
{
|
|
if (input)
|
|
{
|
|
JCGO_ARRAY_NZIACCESS(readFDs, 0)= fd;
|
|
}
|
|
if (output)
|
|
{
|
|
JCGO_ARRAY_NZIACCESS(writeFDs, 0)= fd;
|
|
}
|
|
if (urgent)
|
|
{
|
|
JCGO_ARRAY_NZIACCESS(exceptFDs, 0)= fd;
|
|
}
|
|
if (!isTimeout)
|
|
{
|
|
timeout= (gnu_java_net_VMPlainSocketImpl__getTimeoutOfDeadline__J(
|
|
deadline));
|
|
res= 0;
|
|
if (timeout <= 0)
|
|
{
|
|
break;
|
|
}
|
|
(gnu_java_net_VMPlainSocketImpl__checkThreadInterrupted__());
|
|
}
|
|
res= (gnu_java_net_VMPlainSocketImpl__socketSelect0__IAIIAIIAII(
|
|
readFDs, writeFDs, exceptFDs, JCGO_ARRAY_NZLENGTH(readFDs), JCGO_ARRAY_NZLENGTH(writeFDs),
|
|
JCGO_ARRAY_NZLENGTH(exceptFDs), gnu_java_net_VMPlainSocketImpl__preventBlocking?
|
|
0 : timeout));
|
|
if (res >= 0)
|
|
{
|
|
if (res != 0 || !gnu_java_net_VMPlainSocketImpl__preventBlocking)
|
|
{
|
|
break;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if ((gnu_java_net_VMPlainSocketImpl__isSocketErrInterrupted0__I(
|
|
res)) == 0)
|
|
{
|
|
break;
|
|
}
|
|
}
|
|
isTimeout= (jboolean)jfalse;
|
|
(java_lang_Thread__yield__());
|
|
}
|
|
while (jtrue);
|
|
if (res == 0)
|
|
{
|
|
JCGO_THROW_EXC(java_net_SocketTimeoutException__new__());
|
|
}
|
|
}
|
|
return deadline;
|
|
}
|
|
}
|
|
|
|
JCGO_NOSEP_STATIC void CFASTCALL
|
|
gnu_java_net_VMPlainSocketImpl__setTimeoutFor__II( jint fd, jint timeout
|
|
)
|
|
{
|
|
{
|
|
{
|
|
JCGO_SYNC_BLOCKSAFENZ(gnu_java_net_VMPlainSocketImpl__EMPTY_FDS)
|
|
{
|
|
if (gnu_java_net_VMPlainSocketImpl__timeouts == jnull)
|
|
{
|
|
if (timeout == 0)
|
|
{
|
|
#ifndef JCGO_SEHTRY
|
|
JCGO_SYNC_JUMPLEAVE(0);
|
|
#endif
|
|
return;
|
|
}
|
|
gnu_java_net_VMPlainSocketImpl__timeouts= java_util_HashMap__new__();
|
|
}
|
|
if (timeout != 0)
|
|
{
|
|
jObject jcgo_rcvrL1;
|
|
jObject jcgo_rcvrL2;
|
|
(jcgo_rcvrL1= (jObject)gnu_java_net_VMPlainSocketImpl__timeouts,
|
|
jcgo_rcvrL2= (jObject)(java_lang_Integer__new__I(
|
|
fd)), JCGO_CALL_FINALF((java_util_HashMap)jcgo_rcvrL1) java_util_HashMap__put__LoLo(
|
|
(java_util_HashMap)jcgo_rcvrL1, (java_lang_Object)jcgo_rcvrL2,
|
|
(java_lang_Object)(java_lang_Integer__new__I(
|
|
timeout))));
|
|
}
|
|
else
|
|
{
|
|
jObject jcgo_rcvrL1;
|
|
(jcgo_rcvrL1= (jObject)gnu_java_net_VMPlainSocketImpl__timeouts,
|
|
JCGO_CALL_FINALF((java_util_HashMap)jcgo_rcvrL1) java_util_HashMap__remove__Lo(
|
|
(java_util_HashMap)jcgo_rcvrL1, (java_lang_Object)(java_lang_Integer__new__I(
|
|
fd))));
|
|
}
|
|
}
|
|
JCGO_SYNC_END
|
|
}
|
|
}
|
|
}
|
|
|
|
JCGO_NOSEP_STATIC jint CFASTCALL
|
|
gnu_java_net_VMPlainSocketImpl__getTimeoutFor__I( jint fd )
|
|
{
|
|
{
|
|
jint timeout;
|
|
timeout= 0;
|
|
if (gnu_java_net_VMPlainSocketImpl__timeouts != jnull)
|
|
{
|
|
{
|
|
JCGO_SYNC_BLOCKSAFENZ(gnu_java_net_VMPlainSocketImpl__EMPTY_FDS)
|
|
{
|
|
if (gnu_java_net_VMPlainSocketImpl__timeouts != jnull)
|
|
{
|
|
java_lang_Object value;
|
|
jObject jcgo_rcvrL1;
|
|
value= (jcgo_rcvrL1= (jObject)gnu_java_net_VMPlainSocketImpl__timeouts,
|
|
JCGO_CALL_FINALF((java_util_HashMap)jcgo_rcvrL1) java_util_HashMap__get__Lo(
|
|
(java_util_HashMap)jcgo_rcvrL1, (java_lang_Object)(java_lang_Integer__new__I(
|
|
fd))));
|
|
if (value != jnull)
|
|
{
|
|
timeout= (java_lang_Integer__intValue__(
|
|
((java_lang_Integer)JCGO_CAST_OBJECT0(OBJT_java_lang_Integer,
|
|
MAXT_java_lang_Integer, value))));
|
|
}
|
|
}
|
|
}
|
|
JCGO_SYNC_END
|
|
}
|
|
}
|
|
return timeout;
|
|
}
|
|
}
|
|
|
|
JCGO_NOSEP_STATIC java_net_InetAddress CFASTCALL
|
|
gnu_java_net_VMPlainSocketImpl__toInetAddress__BAI( jbyteArr ip, jint
|
|
iplen )
|
|
{
|
|
{
|
|
{
|
|
JCGO_TRY_BLOCK
|
|
{
|
|
if (JCGO_ARRAY_LENGTH(ip) != iplen)
|
|
{
|
|
jbyteArr newip;
|
|
if (JCGO_ARRAY_NZLENGTH(ip) < iplen)
|
|
{
|
|
JCGO_THROW_EXC(java_net_UnknownHostException__new__());
|
|
}
|
|
newip= (jbyteArr)jcgo_newArray(JCGO_CORECLASS_FOR(OBJT_jbyte),
|
|
0, iplen);
|
|
(java_lang_System__arraycopy__LoILoII(
|
|
(java_lang_Object)ip, (java_lang_Object)newip, 0, 0, iplen));
|
|
ip= newip;
|
|
}
|
|
{
|
|
java_net_InetAddress jcgo_retval= (java_net_InetAddress__getByAddress__BA(
|
|
ip));
|
|
#ifndef JCGO_SEHTRY
|
|
jcgo_tryLeave();
|
|
#endif
|
|
return jcgo_retval;
|
|
}
|
|
}
|
|
JCGO_TRY_LEAVE
|
|
JCGO_TRY_CATCHES(1)
|
|
JCGO_TRY_CATCH(OBJT_java_net_UnknownHostException, MAXT_java_net_UnknownHostException)
|
|
{
|
|
JCGO_THROW_EXC((java_net_SocketException__new__Ls(
|
|
JCGO_STRREF_OF(jcgo_string8_VMPlScIm))));
|
|
}
|
|
JCGO_TRY_RETHROW(1)
|
|
}
|
|
}
|
|
return jnull;
|
|
}
|
|
|
|
JCGO_NOSEP_STATIC jint CFASTCALL
|
|
gnu_java_net_VMPlainSocketImpl__getTimeoutOfDeadline__J( jlong deadline
|
|
)
|
|
{
|
|
{
|
|
jlong timeleft;
|
|
timeleft= deadline - (java_lang_System__currentTimeMillis__());
|
|
return timeleft > JLONG_C(0)? (timeleft < JLONG_C(0x7fffffff)? (jint)timeleft :
|
|
JCGO_USHR_F((-(jint)1), (jint)1)) : 0;
|
|
}
|
|
}
|
|
|
|
JCGO_NOSEP_STATIC jboolean CFASTCALL
|
|
gnu_java_net_VMPlainSocketImpl__isSocketRetryNeededOnce__I( jint res
|
|
)
|
|
{
|
|
{
|
|
java_lang_Runtime runtime;
|
|
if (res >= 0 || (gnu_java_net_VMPlainSocketImpl__isSocketErrNoResources0__I(
|
|
res)) == 0)
|
|
{
|
|
return (jboolean)jfalse;
|
|
}
|
|
runtime= (java_lang_Runtime__getRuntime__());
|
|
(java_lang_Runtime__gc__(
|
|
runtime));
|
|
(java_lang_Runtime__runFinalization__(
|
|
runtime));
|
|
return (jboolean)jtrue;
|
|
}
|
|
}
|
|
|
|
JCGO_NOSEP_STATIC void CFASTCALL
|
|
gnu_java_net_VMPlainSocketImpl__checkSocketResCode__I( jint res )
|
|
{
|
|
{
|
|
if (res < 0)
|
|
{
|
|
java_lang_String message;
|
|
message= (gnu_java_net_VMPlainSocketImpl__getSocketErrorMsg0__I(
|
|
res));
|
|
if ((gnu_java_net_VMPlainSocketImpl__isSocketErrAddrNotAvail0__I(
|
|
res)) != 0)
|
|
{
|
|
JCGO_THROW_EXC((java_net_BindException__new__Ls(
|
|
message)));
|
|
}
|
|
if ((gnu_java_net_VMPlainSocketImpl__isSocketErrHostUnreach0__I(
|
|
res)) != 0)
|
|
{
|
|
JCGO_THROW_EXC((java_net_NoRouteToHostException__new__Ls(
|
|
message)));
|
|
}
|
|
if ((gnu_java_net_VMPlainSocketImpl__isSocketErrResetConn0__I(
|
|
res)) != 0)
|
|
{
|
|
JCGO_THROW_EXC((java_net_PortUnreachableException__new__Ls(
|
|
message)));
|
|
}
|
|
JCGO_THROW_EXC((java_net_SocketException__new__Ls(
|
|
message)));
|
|
}
|
|
}
|
|
}
|
|
|
|
JCGO_NOSEP_STATIC jint CFASTCALL
|
|
gnu_java_net_VMPlainSocketImpl__isSocketErrAddrNotAvail0__I( jint
|
|
res )
|
|
{
|
|
#ifdef NOJAVA_gnu_java_net_VMPlainSocketImpl_isSocketErrAddrNotAvail0
|
|
jcgo_jniNoNativeFunc();
|
|
return (jint)0;
|
|
#else
|
|
jint jcgo_retval;
|
|
JCGO_JNI_BLOCK(0)
|
|
jcgo_retval= JCGO_JNI_FUNC(Java_gnu_java_net_VMPlainSocketImpl_isSocketErrAddrNotAvail0)(jcgo_pJniEnv,
|
|
(jclass)JCGO_JNI_TOLOCALREF(0, JCGO_CLASSREF_OF(gnu_java_net_VMPlainSocketImpl__class)),
|
|
res);
|
|
jcgo_jniLeave(jcgo_pJniEnv, NULL);
|
|
return jcgo_retval;
|
|
#endif
|
|
}
|
|
|
|
JCGO_NOSEP_STATIC jint CFASTCALL
|
|
gnu_java_net_VMPlainSocketImpl__isSocketErrConnInProgress0__I( jint
|
|
res )
|
|
{
|
|
#ifdef NOJAVA_gnu_java_net_VMPlainSocketImpl_isSocketErrConnInProgress0
|
|
jcgo_jniNoNativeFunc();
|
|
return (jint)0;
|
|
#else
|
|
jint jcgo_retval;
|
|
JCGO_JNI_BLOCK(0)
|
|
jcgo_retval= JCGO_JNI_FUNC(Java_gnu_java_net_VMPlainSocketImpl_isSocketErrConnInProgress0)(jcgo_pJniEnv,
|
|
(jclass)JCGO_JNI_TOLOCALREF(0, JCGO_CLASSREF_OF(gnu_java_net_VMPlainSocketImpl__class)),
|
|
res);
|
|
jcgo_jniLeave(jcgo_pJniEnv, NULL);
|
|
return jcgo_retval;
|
|
#endif
|
|
}
|
|
|
|
JCGO_NOSEP_STATIC jint CFASTCALL
|
|
gnu_java_net_VMPlainSocketImpl__isSocketErrConnected0__I( jint res
|
|
)
|
|
{
|
|
#ifdef NOJAVA_gnu_java_net_VMPlainSocketImpl_isSocketErrConnected0
|
|
jcgo_jniNoNativeFunc();
|
|
return (jint)0;
|
|
#else
|
|
jint jcgo_retval;
|
|
JCGO_JNI_BLOCK(0)
|
|
jcgo_retval= JCGO_JNI_FUNC(Java_gnu_java_net_VMPlainSocketImpl_isSocketErrConnected0)(jcgo_pJniEnv,
|
|
(jclass)JCGO_JNI_TOLOCALREF(0, JCGO_CLASSREF_OF(gnu_java_net_VMPlainSocketImpl__class)),
|
|
res);
|
|
jcgo_jniLeave(jcgo_pJniEnv, NULL);
|
|
return jcgo_retval;
|
|
#endif
|
|
}
|
|
|
|
JCGO_NOSEP_STATIC jint CFASTCALL
|
|
gnu_java_net_VMPlainSocketImpl__isSocketErrHostUnreach0__I( jint res
|
|
)
|
|
{
|
|
#ifdef NOJAVA_gnu_java_net_VMPlainSocketImpl_isSocketErrHostUnreach0
|
|
jcgo_jniNoNativeFunc();
|
|
return (jint)0;
|
|
#else
|
|
jint jcgo_retval;
|
|
JCGO_JNI_BLOCK(0)
|
|
jcgo_retval= JCGO_JNI_FUNC(Java_gnu_java_net_VMPlainSocketImpl_isSocketErrHostUnreach0)(jcgo_pJniEnv,
|
|
(jclass)JCGO_JNI_TOLOCALREF(0, JCGO_CLASSREF_OF(gnu_java_net_VMPlainSocketImpl__class)),
|
|
res);
|
|
jcgo_jniLeave(jcgo_pJniEnv, NULL);
|
|
return jcgo_retval;
|
|
#endif
|
|
}
|
|
|
|
JCGO_NOSEP_STATIC jint CFASTCALL
|
|
gnu_java_net_VMPlainSocketImpl__isSocketErrInterrupted0__I( jint res
|
|
)
|
|
{
|
|
#ifdef NOJAVA_gnu_java_net_VMPlainSocketImpl_isSocketErrInterrupted0
|
|
jcgo_jniNoNativeFunc();
|
|
return (jint)0;
|
|
#else
|
|
jint jcgo_retval;
|
|
JCGO_JNI_BLOCK(0)
|
|
jcgo_retval= JCGO_JNI_FUNC(Java_gnu_java_net_VMPlainSocketImpl_isSocketErrInterrupted0)(jcgo_pJniEnv,
|
|
(jclass)JCGO_JNI_TOLOCALREF(0, JCGO_CLASSREF_OF(gnu_java_net_VMPlainSocketImpl__class)),
|
|
res);
|
|
jcgo_jniLeave(jcgo_pJniEnv, NULL);
|
|
return jcgo_retval;
|
|
#endif
|
|
}
|
|
|
|
JCGO_NOSEP_STATIC java_lang_String CFASTCALL
|
|
gnu_java_net_VMPlainSocketImpl__getSocketErrorMsg0__I( jint res )
|
|
{
|
|
#ifdef NOJAVA_gnu_java_net_VMPlainSocketImpl_getSocketErrorMsg0
|
|
jcgo_jniNoNativeFunc();
|
|
return jnull;
|
|
#else
|
|
JCGO_JNI_BLOCK(0)
|
|
return (java_lang_String)jcgo_jniLeave(jcgo_pJniEnv, (jobject)JCGO_JNI_FUNC(Java_gnu_java_net_VMPlainSocketImpl_getSocketErrorMsg0)(jcgo_pJniEnv,
|
|
(jclass)JCGO_JNI_TOLOCALREF(0, JCGO_CLASSREF_OF(gnu_java_net_VMPlainSocketImpl__class)),
|
|
res));
|
|
#endif
|
|
}
|
|
|
|
JCGO_NOSEP_STATIC jint CFASTCALL
|
|
gnu_java_net_VMPlainSocketImpl__socketConnect0__IBAII( jbyteArr ip,
|
|
jint fd, jint iplen, jint port )
|
|
{
|
|
#ifdef NOJAVA_gnu_java_net_VMPlainSocketImpl_socketConnect0
|
|
jcgo_jniNoNativeFunc();
|
|
return (jint)0;
|
|
#else
|
|
jint jcgo_retval;
|
|
JCGO_JNI_BLOCK(1)
|
|
jcgo_retval= JCGO_JNI_FUNC(Java_gnu_java_net_VMPlainSocketImpl_socketConnect0)(jcgo_pJniEnv,
|
|
(jclass)JCGO_JNI_TOLOCALREF(0, JCGO_CLASSREF_OF(gnu_java_net_VMPlainSocketImpl__class)),
|
|
fd, (jbyteArray)JCGO_JNI_TOLOCALREF(1, ip), iplen, port);
|
|
jcgo_jniLeave(jcgo_pJniEnv, NULL);
|
|
return jcgo_retval;
|
|
#endif
|
|
}
|
|
|
|
JCGO_NOSEP_STATIC jint CFASTCALL
|
|
gnu_java_net_VMPlainSocketImpl__socketSelect0__IAIIAIIAII( jintArr
|
|
readFDs, jintArr writeFDs, jintArr exceptFDs, jint readFDsLen, jint
|
|
writeFDsLen, jint exceptFDsLen, jint timeout )
|
|
{
|
|
#ifdef NOJAVA_gnu_java_net_VMPlainSocketImpl_socketSelect0
|
|
jcgo_jniNoNativeFunc();
|
|
return (jint)0;
|
|
#else
|
|
jint jcgo_retval;
|
|
JCGO_JNI_BLOCK(3)
|
|
jcgo_retval= JCGO_JNI_FUNC(Java_gnu_java_net_VMPlainSocketImpl_socketSelect0)(jcgo_pJniEnv,
|
|
(jclass)JCGO_JNI_TOLOCALREF(0, JCGO_CLASSREF_OF(gnu_java_net_VMPlainSocketImpl__class)),
|
|
(jintArray)JCGO_JNI_TOLOCALREF(1, readFDs), readFDsLen, (jintArray)JCGO_JNI_TOLOCALREF(2,
|
|
writeFDs), writeFDsLen, (jintArray)JCGO_JNI_TOLOCALREF(3, exceptFDs),
|
|
exceptFDsLen, timeout);
|
|
jcgo_jniLeave(jcgo_pJniEnv, NULL);
|
|
return jcgo_retval;
|
|
#endif
|
|
}
|
|
|
|
JCGO_NOSEP_STATIC jint CFASTCALL
|
|
gnu_java_net_VMPlainSocketImpl__socketSetNonBlocking0__II( jint fd,
|
|
jint on )
|
|
{
|
|
#ifdef NOJAVA_gnu_java_net_VMPlainSocketImpl_socketSetNonBlocking0
|
|
jcgo_jniNoNativeFunc();
|
|
return (jint)0;
|
|
#else
|
|
jint jcgo_retval;
|
|
JCGO_JNI_BLOCK(0)
|
|
jcgo_retval= JCGO_JNI_FUNC(Java_gnu_java_net_VMPlainSocketImpl_socketSetNonBlocking0)(jcgo_pJniEnv,
|
|
(jclass)JCGO_JNI_TOLOCALREF(0, JCGO_CLASSREF_OF(gnu_java_net_VMPlainSocketImpl__class)),
|
|
fd, on);
|
|
jcgo_jniLeave(jcgo_pJniEnv, NULL);
|
|
return jcgo_retval;
|
|
#endif
|
|
}
|
|
|
|
JCGO_NOSEP_STATIC jint CFASTCALL
|
|
gnu_java_net_VMPlainSocketImpl__socketGetSetOption0__III( jint fd,
|
|
jint optionId, jint optval )
|
|
{
|
|
#ifdef NOJAVA_gnu_java_net_VMPlainSocketImpl_socketGetSetOption0
|
|
jcgo_jniNoNativeFunc();
|
|
return (jint)0;
|
|
#else
|
|
jint jcgo_retval;
|
|
JCGO_JNI_BLOCK(0)
|
|
jcgo_retval= JCGO_JNI_FUNC(Java_gnu_java_net_VMPlainSocketImpl_socketGetSetOption0)(jcgo_pJniEnv,
|
|
(jclass)JCGO_JNI_TOLOCALREF(0, JCGO_CLASSREF_OF(gnu_java_net_VMPlainSocketImpl__class)),
|
|
fd, optionId, optval);
|
|
jcgo_jniLeave(jcgo_pJniEnv, NULL);
|
|
return jcgo_retval;
|
|
#endif
|
|
}
|
|
|
|
JCGO_NOSEP_DATA CONST struct gnu_java_net_VMPlainSocketImpl_methods_s
|
|
gnu_java_net_VMPlainSocketImpl_methods=
|
|
{
|
|
JCGO_CLASSREF_OF(gnu_java_net_VMPlainSocketImpl__class),
|
|
JCGO_GCJDESCR_ZEROINIT
|
|
OBJT_gnu_java_net_VMPlainSocketImpl,
|
|
(JCGO_OBJSIZE_T)sizeof(struct gnu_java_net_VMPlainSocketImpl_s),
|
|
NULL,
|
|
JCGO_CLINIT_INIT(0)
|
|
gnu_java_net_VMPlainSocketImpl__this__,
|
|
java_lang_Object__equals__Lo,
|
|
java_lang_Object__hashCode__,
|
|
java_lang_Object__toString__,
|
|
java_lang_Object__finalize__
|
|
};
|
|
|
|
JCGO_NOSEP_DATA JCGO_NOTHR_CONST struct gnu_java_net_VMPlainSocketImpl_class_s
|
|
gnu_java_net_VMPlainSocketImpl__class JCGO_THRD_ATTRNONGC=
|
|
{
|
|
{
|
|
&java_lang_Class_methods,
|
|
JCGO_MON_INIT
|
|
JCGO_OBJREF_OF(*(java_lang_Object)&gnu_java_net_VMPlainSocketImpl_methods),
|
|
JCGO_STRREF_OF(jcgo_string1_VMPlScIm),
|
|
JCGO_CLASSREF_OF(java_lang_Object__class),
|
|
((jObjectArr)JCGO_OBJREF_OF(jcgo_array3_Object)),
|
|
0x111
|
|
}
|
|
};
|
|
|
|
JCGO_NOSEP_GCDATA java_util_HashMap gnu_java_net_VMPlainSocketImpl__timeouts
|
|
ATTRIBGCBSS= jnull;
|
|
|
|
JCGO_NOSEP_DATA jboolean gnu_java_net_VMPlainSocketImpl__initialized=
|
|
(jboolean)0;
|
|
|
|
JCGO_NOSEP_DATA jboolean gnu_java_net_VMPlainSocketImpl__preventBlocking=
|
|
(jboolean)0;
|
|
|
|
JCGO_NOSEP_DATA JCGO_NOTHR_CONST jcgo_arrtype4_VMChnnl jcgo_array2_VMPlScIm
|
|
JCGO_THRD_ATTRNONGC=
|
|
{
|
|
(jvtable)&jintArr_methods,
|
|
JCGO_MON_INIT
|
|
0,
|
|
{
|
|
(jint)0
|
|
}
|
|
};
|
|
|
|
JCGO_NOSEP_DATA JCGO_NOTHR_CONST jcgo_arrtype2_VMChnnl jcgo_array3_VMPlScIm
|
|
JCGO_THRD_ATTRNONGC=
|
|
{
|
|
(jvtable)&jbyteArr_methods,
|
|
JCGO_MON_INIT
|
|
0,
|
|
{
|
|
(jbyte)0
|
|
}
|
|
};
|
|
|
|
JCGO_NOSEP_DATA CONST jcgo_arrtype75_GmCnnctn jcgo_array9_VMPlScIm=
|
|
{
|
|
(jvtable)&jbyteArr_methods,
|
|
JCGO_MON_INIT
|
|
36,
|
|
{
|
|
(jbyte)(jchar)103/*'g'*/, (jbyte)(jchar)110/*'n'*/, (jbyte)(jchar)117/*'u'*/,
|
|
(jbyte)(jchar)46/*'.'*/, (jbyte)(jchar)106/*'j'*/, (jbyte)(jchar)97/*'a'*/,
|
|
(jbyte)(jchar)118/*'v'*/, (jbyte)(jchar)97/*'a'*/, (jbyte)(jchar)46/*'.'*/,
|
|
(jbyte)(jchar)110/*'n'*/, (jbyte)(jchar)101/*'e'*/, (jbyte)(jchar)116/*'t'*/,
|
|
(jbyte)(jchar)46/*'.'*/, (jbyte)(jchar)86/*'V'*/, (jbyte)(jchar)77/*'M'*/,
|
|
(jbyte)(jchar)80/*'P'*/, (jbyte)(jchar)108/*'l'*/, (jbyte)(jchar)97/*'a'*/,
|
|
(jbyte)(jchar)105/*'i'*/, (jbyte)(jchar)110/*'n'*/, (jbyte)(jchar)83/*'S'*/,
|
|
(jbyte)(jchar)111/*'o'*/, (jbyte)(jchar)99/*'c'*/, (jbyte)(jchar)107/*'k'*/,
|
|
(jbyte)(jchar)101/*'e'*/, (jbyte)(jchar)116/*'t'*/, (jbyte)(jchar)73/*'I'*/,
|
|
(jbyte)(jchar)109/*'m'*/, (jbyte)(jchar)112/*'p'*/, (jbyte)(jchar)108/*'l'*/,
|
|
(jbyte)(jchar)36/*'$'*/, (jbyte)(jchar)83/*'S'*/, (jbyte)(jchar)116/*'t'*/,
|
|
(jbyte)(jchar)97/*'a'*/, (jbyte)(jchar)116/*'t'*/, (jbyte)(jchar)101/*'e'*/
|
|
}
|
|
};
|
|
|
|
JCGO_NOSEP_DATA CONST jcgo_arrtype23_Object jcgo_array10_VMPlScIm=
|
|
{
|
|
(jvtable)&jbyteArr_methods,
|
|
JCGO_MON_INIT
|
|
20,
|
|
{
|
|
(jbyte)(jchar)105/*'i'*/, (jbyte)(jchar)110/*'n'*/, (jbyte)(jchar)118/*'v'*/,
|
|
(jbyte)(jchar)97/*'a'*/, (jbyte)(jchar)108/*'l'*/, (jbyte)(jchar)105/*'i'*/,
|
|
(jbyte)(jchar)100/*'d'*/, (jbyte)(jchar)32/*' '*/, (jbyte)(jchar)111/*'o'*/,
|
|
(jbyte)(jchar)112/*'p'*/, (jbyte)(jchar)116/*'t'*/, (jbyte)(jchar)105/*'i'*/,
|
|
(jbyte)(jchar)111/*'o'*/, (jbyte)(jchar)110/*'n'*/, (jbyte)(jchar)32/*' '*/,
|
|
(jbyte)(jchar)118/*'v'*/, (jbyte)(jchar)97/*'a'*/, (jbyte)(jchar)108/*'l'*/,
|
|
(jbyte)(jchar)117/*'u'*/, (jbyte)(jchar)101/*'e'*/
|
|
}
|
|
};
|
|
|
|
JCGO_NOSEP_DATA CONST jcgo_arrtype108_GmCnnctn jcgo_array11_VMPlScIm=
|
|
{
|
|
(jvtable)&jbyteArr_methods,
|
|
JCGO_MON_INIT
|
|
25,
|
|
{
|
|
(jbyte)(jchar)99/*'c'*/, (jbyte)(jchar)97/*'a'*/, (jbyte)(jchar)110/*'n'*/,
|
|
(jbyte)(jchar)110/*'n'*/, (jbyte)(jchar)111/*'o'*/, (jbyte)(jchar)116/*'t'*/,
|
|
(jbyte)(jchar)32/*' '*/, (jbyte)(jchar)105/*'i'*/, (jbyte)(jchar)110/*'n'*/,
|
|
(jbyte)(jchar)105/*'i'*/, (jbyte)(jchar)116/*'t'*/, (jbyte)(jchar)105/*'i'*/,
|
|
(jbyte)(jchar)97/*'a'*/, (jbyte)(jchar)108/*'l'*/, (jbyte)(jchar)105/*'i'*/,
|
|
(jbyte)(jchar)122/*'z'*/, (jbyte)(jchar)101/*'e'*/, (jbyte)(jchar)32/*' '*/,
|
|
(jbyte)(jchar)115/*'s'*/, (jbyte)(jchar)111/*'o'*/, (jbyte)(jchar)99/*'c'*/,
|
|
(jbyte)(jchar)107/*'k'*/, (jbyte)(jchar)101/*'e'*/, (jbyte)(jchar)116/*'t'*/,
|
|
(jbyte)(jchar)115/*'s'*/
|
|
}
|
|
};
|
|
|
|
JCGO_NOSEP_DATA CONST jcgo_arrtype94_GmCnnctn jcgo_array12_VMPlScIm=
|
|
{
|
|
(jvtable)&jbyteArr_methods,
|
|
JCGO_MON_INIT
|
|
24,
|
|
{
|
|
(jbyte)(jchar)73/*'I'*/, (jbyte)(jchar)110/*'n'*/, (jbyte)(jchar)118/*'v'*/,
|
|
(jbyte)(jchar)97/*'a'*/, (jbyte)(jchar)108/*'l'*/, (jbyte)(jchar)105/*'i'*/,
|
|
(jbyte)(jchar)100/*'d'*/, (jbyte)(jchar)32/*' '*/, (jbyte)(jchar)100/*'d'*/,
|
|
(jbyte)(jchar)101/*'e'*/, (jbyte)(jchar)115/*'s'*/, (jbyte)(jchar)116/*'t'*/,
|
|
(jbyte)(jchar)105/*'i'*/, (jbyte)(jchar)110/*'n'*/, (jbyte)(jchar)97/*'a'*/,
|
|
(jbyte)(jchar)116/*'t'*/, (jbyte)(jchar)105/*'i'*/, (jbyte)(jchar)111/*'o'*/,
|
|
(jbyte)(jchar)110/*'n'*/, (jbyte)(jchar)32/*' '*/, (jbyte)(jchar)112/*'p'*/,
|
|
(jbyte)(jchar)111/*'o'*/, (jbyte)(jchar)114/*'r'*/, (jbyte)(jchar)116/*'t'*/
|
|
}
|
|
};
|
|
|
|
JCGO_NOSEP_DATA JCGO_NOTHR_CONST struct java_lang_String_s jcgo_string1_VMPlScIm
|
|
JCGO_THRD_ATTRNONGC=
|
|
{
|
|
&java_lang_String_methods,
|
|
JCGO_MON_INIT
|
|
(java_lang_Object)JCGO_OBJREF_OF(jcgo_array9_VMPlScIm),
|
|
0, 30, (jint)0x483c3689L
|
|
};
|
|
|
|
JCGO_NOSEP_DATA JCGO_NOTHR_CONST struct java_lang_String_s jcgo_string4_VMPlScIm
|
|
JCGO_THRD_ATTRNONGC=
|
|
{
|
|
&java_lang_String_methods,
|
|
JCGO_MON_INIT
|
|
(java_lang_Object)JCGO_OBJREF_OF(jcgo_array10_VMPlScIm),
|
|
0, 20, (jint)0x9a03498fL
|
|
};
|
|
|
|
JCGO_NOSEP_DATA JCGO_NOTHR_CONST struct java_lang_String_s jcgo_string5_VMPlScIm
|
|
JCGO_THRD_ATTRNONGC=
|
|
{
|
|
&java_lang_String_methods,
|
|
JCGO_MON_INIT
|
|
(java_lang_Object)JCGO_OBJREF_OF(jcgo_array494_VMSstmPr),
|
|
0, 20, (jint)0xc82ba4bL
|
|
};
|
|
|
|
JCGO_NOSEP_DATA JCGO_NOTHR_CONST struct java_lang_String_s jcgo_string6_VMPlScIm
|
|
JCGO_THRD_ATTRNONGC=
|
|
{
|
|
&java_lang_String_methods,
|
|
JCGO_MON_INIT
|
|
(java_lang_Object)JCGO_OBJREF_OF(jcgo_array11_VMPlScIm),
|
|
0, 25, (jint)0xb10f690dL
|
|
};
|
|
|
|
JCGO_NOSEP_DATA JCGO_NOTHR_CONST struct java_lang_String_s jcgo_string7_VMPlScIm
|
|
JCGO_THRD_ATTRNONGC=
|
|
{
|
|
&java_lang_String_methods,
|
|
JCGO_MON_INIT
|
|
(java_lang_Object)JCGO_OBJREF_OF(jcgo_array12_VMPlScIm),
|
|
0, 24, (jint)0xbb1adc7cL
|
|
};
|
|
|
|
JCGO_NOSEP_DATA JCGO_NOTHR_CONST struct java_lang_String_s jcgo_string8_VMPlScIm
|
|
JCGO_THRD_ATTRNONGC=
|
|
{
|
|
&java_lang_String_methods,
|
|
JCGO_MON_INIT
|
|
(java_lang_Object)JCGO_OBJREF_OF(jcgo_array34_Surface),
|
|
0, 22, (jint)0xaa0cd659L
|
|
};
|
|
|
|
#ifdef CHKALL_gnu_java_net_VMPlainSocketImpl
|
|
#include "jcgochke.h"
|
|
#endif
|
|
|
|
#endif
|