[ 
https://issues.apache.org/jira/browse/AXIS2C-1190?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12608975#action_12608975
 ] 

Damitha Kumarage commented on AXIS2C-1190:
------------------------------------------

Senaka,
This is about non-blocking samples where you have to set a callback. It seems 
you haven't understood what I have explained. In the code block I have pasted, 
the only axis2_ prefix I use is for axis2_callback_get_comlete() which is an 
axis2 function defined for callback structure.

What I have explained is an another way of doing the same thing where you don't 
pass a callback function to the callback, instead use the 
axis2_callback_get_complete() function to find the state of the invocation and 
then use our own client function to process the result which is contained in 
the callback and could be retrieved using axis2_callback_get_envelope().

Whether you use the axis2_callback_get_complete() or updating a variable 
is_complete in your callback function does not make any difference. It is just 
two ways of doing the same thing.
Please refer to echo_non_blocking sample and echo_non_blocking_dual samples to 
understand this where echo_non_blocking sample contain the code I explained and 
echo_non_blocking_dual contain the old way of doing it.

Yes my topic could be wrong because it say this is a improvement. It is not a 
improvement. It is another way of doing same thing. So I only updated the 
echo_non_blocking sample in the new way keeping the echo_non_blocking_dual 
sample in the old way so the user can understand the different ways of doing 
things. 


> Non blocking samples could be improved by the use of 
> axis2_callback_get_complete function.
> ------------------------------------------------------------------------------------------
>
>                 Key: AXIS2C-1190
>                 URL: https://issues.apache.org/jira/browse/AXIS2C-1190
>             Project: Axis2-C
>          Issue Type: Bug
>         Environment: all
>            Reporter: Damitha Kumarage
>            Assignee: Damitha Kumarage
>             Fix For: 1.4.1
>
>
> I can see that in non blocking samples it keep variable isComplete which is 
> updated from within the on_complte callback function to notify the 
> application client that response has arrived. Meanwhile client is in a while 
> loop which look for the change in onComplete variable for loop break.
> I think it is more advisable simpler  to use following in the client code 
> which use axis2_callback_get_complete function.
> while(!axis2_callback_get_comlete(callback, env))
> {
>     AXIS2_SLLEP(1);
>     if(count < 30)
>     {
>         count++; 
>     }
>     else
>     {
>         printf("\necho client invoke failed. Counter timed out. \n"); 
>     }
> }
> echo_process_result_node(callback, env);
> Note that echo_process_result_node(callback, env) function
> has the same content as the echo_callback_on_complete() function. Only the 
> name
> is changed for appropriateness.
> Also significant change is not passing a callback function with the callback. 
> This is not needed.
> Once response come back the callback has the response envelope set. Calling 
> echo_process_result_node
> we can process this result appropriatley.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to