[omniORB] Exception while sending an octet sequence

Ali Reza A.Reza at zensar.com
Wed Nov 19 20:45:00 GMT 2003


I have encountered the following exception while trying to use an octet sequence....

CORBA System ExceptionIDL:omg.org/CORBA/UNKNOWN:1.0
Completion status 2
Minor 1330446337
Meaningful name for minor code UNKNOWN_UserException

My servant code is...

BinaryFile* TS::BinaryFileExchange_impl::fetch(const char* file_name)
{
  int file_handle = open(file_name,_A_RDONLY);
  struct stat stat_values;
  fstat(file_handle,&stat_values);
  CORBA::Octet *image_oct_buf;
  image_oct_buf = new CORBA::Octet(stat_values.st_size);
  BinaryFile *image_seq = new BinaryFile(stat_values.st_size);
  image_seq->length(stat_values.st_size);

  
  read(file_handle,image_oct_buf,stat_values.st_size);
  for (int i = 0; i < stat_values.st_size ; ++i) {
    *(image_seq + i) = *(image_oct_buf + i);
  }
  delete [] image_oct_buf;
  close(file_handle);
	    
  return image_seq
}

// My IDL is ...
  typedef sequence<octet> BinaryFile;
  interface BinaryFileExchange {
    void send(in BinaryFile f, in string file_name);
    BinaryFile fetch(in string file_name);
  };

Could somebody explain whats happening ? Where things are going wrong ??
on   cout <<  "Length of image_seq" << image_seq->length() << endl; 
I get a proper sized sequence i.e. the size of the number of bytes of ,y gif file.

Thx./Ali



More information about the omniORB-list mailing list