----------------------------------------------------------------
BEFORE YOU POST, search the faq at <http://java.apache.org/faq/>
WHEN YOU POST, include all relevant version numbers, log files,
and configuration files. Don't make us guess your problem!!!
----------------------------------------------------------------
from jserv_wrapper_unix.c in JServ1.1b3
/* install SIGALARM handler to implement a timeout in
communication */
/* NOTE: As it is installed in each loop, it should work with
SYSV signal()*/
old_handler = signal( SIGALRM, kill_hung_jvm);
/* We use Ed's facility here to measure the timeout
IMPORTANT: this is what we should expect from this variable
name,
however we have to check if we really should share the same
value
in many places.
*/
alarm(wrapper_data->config->vmtimeout);
/* check if we can communicate to JVM */
if( jvm_pid != 0 &&
jserv_protocol_function(wrapper_data->config->protocol,wrapper_data->config,
JSERV_PING,NULL) == JSERV_FUNC_COMMERROR) {
/* Note that it's harmless that this function is called twice
in case of timeout
*/
kill_hung_jvm(0);
}
/* Remove the signal, no matter if it was used or not */
alarm(0);
from jserv_ajpv12.c from JServ 1.1b3
/* Our function handler */
static int ajpv12_function(jserv_config *cfg, int function, char *data) {
pool *p=ap_make_sub_pool(NULL);
int sock,ret;
char signal[2];
#ifdef WIN32
signal[0] = (char) 254; /* a signal marker */
#else
signal[0] = 254; /* a signal marker */
#endif
if (function==JSERV_SHUTDOWN) {
jserv_error(JSERV_LOG_INFO,cfg,"ajp12: %s",
"sending shutdown signal");
signal[1]=15;
}
else if (function==JSERV_RESTART) {
jserv_error(JSERV_LOG_INFO,cfg,"ajp12: %s",
"sending restart signal");
signal[1]=1;
}
else if (function==JSERV_PING) {
signal[1]=0;
}
else {
jserv_error(JSERV_LOG_ERROR,cfg,"ajp12: %s",
"unknown function requested");
ap_destroy_pool(p);
return JSERV_FUNC_NOTIMPLEMENTED;
}
/* Check for correct config member */
if (cfg==NULL) {
jserv_error(JSERV_LOG_EMERG,cfg,"ajp12: %s",
"unknown configuration member for function");
ap_destroy_pool(p);
return JSERV_FUNC_ERROR;
}
/* Open connection to JServ */
sock=ajpv12_open(cfg, p, cfg->hostaddr, cfg->port);
if (sock==-1) {
jserv_error(JSERV_LOG_EMERG,cfg,"ajp12: %s",
"function connection fail");
ap_destroy_pool(p);
return JSERV_FUNC_COMMERROR;
}
/* Authenticate socket */
ret=ajpv12_auth(cfg, p, sock, cfg->secret, cfg->secretsize);
if (ret==-1) {
jserv_error(JSERV_LOG_EMERG,cfg,"ajp12: function auth fail");
ap_destroy_pool(p);
return JSERV_FUNC_ERROR;
}
/* Send the function request */
ret = write( sock, signal, 2);
if (ret!=2) {
jserv_error(JSERV_LOG_EMERG,cfg,"ajp12: cannot send function");
ap_destroy_pool(p);
return JSERV_FUNC_COMMERROR;
}
/* In case of PING wait for some reply */
if( function==JSERV_PING ) {
int pingret;
pingret = read( sock, signal, 1);
if( pingret != 1) {
jserv_error(JSERV_LOG_EMERG, cfg, "ajp12: ping: no reply (%d) \
Please make sure that the wrapper.classpath is pointing \
to the correct version of ApacheJServ.jar", \
pingret);
ap_destroy_pool(p);
return JSERV_FUNC_COMMERROR;
}
}
It looks to me like wrapper_data->config->vmtimeout is used to tell us how
often to PING (i.e. how often to send the JSERV_PING function call)
However, inside of the ajpv12 protocol, I do not see where it uses the
timeout to see how long to wait for a ping reply. It writes to the socket,
and then expects to almost immediately read back one byte from the socket.
- Greg
--
--------------------------------------------------------------
Please read the FAQ! <http://java.apache.org/faq/>
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Archives and Other: <http://java.apache.org/main/mail.html>
Problems?: [EMAIL PROTECTED]