Results 1 to 4 of 4

Thread: C#: callback (ice_response) problem

  1. #1
    kwaclaw is offline Registered User
    Name: Karl Waclawek
    Organization: Personal
    Project: Whiteboard application
    Join Date
    Sep 2004
    Location
    Oshawa, Canada
    Posts
    159

    C#: callback (ice_response) problem

    I am getting a null pointer exception in the C# generated code when ice_response is called in an async dispatch situation.

    The relevant Slice is:

    Code:
      struct Prop {
        int Index;
        Ice::ByteSeq Value;
      };
      
      sequence<Prop> PropSeq;
    
      interface Store {
         . . .
        ["ami", "amd"] idempotent
        PropSeq Get(Ice::ByteSeq key, Ice::IntSeq propIndexes) throws ServiceError;
         . . .
      };
    The generated code for the call-back is as follows:
    (I have marked the problem spot with a comment)

    Code:
    class _AMD_Store_Get : IceInternal.IncomingAsync, AMD_Store_Get
    {
        public _AMD_Store_Get(IceInternal.Incoming inc) : base(inc)
        {
        }
    
        public void ice_response(Services.StorageServices.Prop[] ret__)
        {
            try
            {
                IceInternal.BasicStream os__ = this.os__();
                if(ret__ == null)
                {
                    os__.writeSize(0);
                }
                else
                {
                    os__.writeSize(ret__.Length);
                    for(int ix__ = 0; ix__ < ret__.Length; ++ix__)
                    {
                        ret__[ix__].write__(os__);  // issue here
                    }
                }
            }
            catch(Ice.LocalException ex__)
            {
                ice_exception(ex__);
            }
            response__(true);
        }
    
        public void ice_exception(_System.Exception ex)
        {
            try
            {
                throw ex;
            }
            catch(Services.ServiceError ex__)
            {
                os__().writeUserException(ex__);
                response__(false);
            }
            catch(_System.Exception ex__)
            {
                exception__(ex__);
            }
        }
    }
    The problem occurs when the returned array contains nulls.

    Karl
    Karl Waclawek

  2. #2
    michi's Avatar
    michi is offline Registered User
    Name: Michi Henning
    Organization: Triodia Technologies
    Project: I have a passing interest in Ice :-)
    Join Date
    Feb 2003
    Location
    Brisbane, Australia
    Posts
    1,055
    Thanks for the bug report. I'll post a patch ASAP.

    Cheers,

    Michi.

  3. #3
    michi's Avatar
    michi is offline Registered User
    Name: Michi Henning
    Organization: Triodia Technologies
    Project: I have a passing interest in Ice :-)
    Join Date
    Feb 2003
    Location
    Brisbane, Australia
    Posts
    1,055
    Hi Karl,

    I've posted a patch for the problem. Thanks for reporting this! You need to apply the patch to cpp/src/Slice/CsUtil.cpp, rebuild slice2cs, and recompile your Slice definitions.

    Cheers,

    Michi.

  4. #4
    kwaclaw is offline Registered User
    Name: Karl Waclawek
    Organization: Personal
    Project: Whiteboard application
    Join Date
    Sep 2004
    Location
    Oshawa, Canada
    Posts
    159
    Quote Originally Posted by michi View Post
    Hi Karl,

    I've posted a patch for the problem. Thanks for reporting this! You need to apply the patch to cpp/src/Slice/CsUtil.cpp, rebuild slice2cs, and recompile your Slice definitions.

    Cheers,

    Michi.
    Thanks, the fix seems to work.
    Karl Waclawek

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. AMD callback - using arguments after ice_response()
    By Andrew S in forum Help Center
    Replies: 4
    Last Post: 01-15-2009, 04:23 AM
  2. Multiple ice_response to a single AMI callback
    By kishore in forum Help Center
    Replies: 3
    Last Post: 06-05-2007, 10:08 PM
  3. demo/ice/callback problem
    By Rerox in forum Help Center
    Replies: 1
    Last Post: 07-27-2005, 04:54 PM
  4. demo/glacier2/callback problem
    By alienwolf in forum Help Center
    Replies: 1
    Last Post: 05-29-2005, 11:52 PM
  5. Callback sample problem
    By zhangzq71 in forum Help Center
    Replies: 3
    Last Post: 05-08-2005, 09:04 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •