IC and CORBA_SYSTEM_EXCEPTION

Steve Langstaff srl@REDACTED
Fri Mar 9 14:31:51 CET 2001


Hi All.

I'm looking at using IC to generate an Erlang:C interface between 2 nodes 
in a network... all is going OK apart from one scenario (so far):

I've got 1 Erlang genserver providing a generic set of client access 
functions.
I've got 2 'C' servers, one of which implements the full IDL-specified 
interface and one which implements a subset...

For the server that implements the full IDL-specified interface, everything 
works OK.

For the server that implements the subset of the IDL-specified interface, I 
want the client
access function call to be informed if the function is not implemented by 
the server.

As far as I can see, the example C server code does not pass back 
CORBA_SYSTEM_EXCEPTION back to the client:

...
	status = ei_receive_encoded(env->_fd, &env->_inbuf, &env->_inbufsz, &msg, 
&env->_iin);
	switch(status) {
	case ERL_SEND:
	case ERL_REG_SEND :
	  /* do transaction with fd */
	  whatever_module__switch(NULL,env);
	
	  switch(env->_major) {
	  case CORBA_NO_EXCEPTION: /* Success */
	    break;
	  case CORBA_SYSTEM_EXCEPTION: /* System exception */
	    printf("Request failure, reason : %s\n",(char *) 
CORBA_exception_value(env));
	  CORBA_exception_free(env);
	  break;
	  default: /* Should not come here */
	    CORBA_exception_free(env);
	    break;
	}
	
	  /* send outdata */
	  if (env->_iout > 0)
	    ei_send_encoded(env->_fd,&env->_caller,env->_outbuf,env->_iout);
	  break;
...

env->_major is set to CORBA_SYSTEM_EXCEPTION because 
whatever_module__switch() does not implement the function. env->_iout count 
appears to be set to 0.

Shouldn't there be some kind of ei_send_encoded() call to return an error 
to the client?

NB. I don't want to use a timeout on the client side because a) I don't 
know the maximum time that valid function calls will take and b) the server 
has detected an error and should be capable of sending an error response.

Ideas?

--
Steve L.




More information about the erlang-questions mailing list