Go Back   ZeroC Forums > Help Center

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 12-23-2005
OrNot OrNot is offline
Registered User
 
Name: Bin.Li
Organization: GE Healthcare
Project: Enterprise solution
 
Join Date: Jun 2005
Location: Shanghai
Posts: 157
Send a message via MSN to OrNot
-->
Question about AMI

hi, there,
If I define a slice like this:

module test
{
["ami"] bool foo();
}

then a function will be produced: void foo_async(....),
1) This invocation is one-way , isn't it?
2) For sequentially-sent AMIs, it is not guaranteed that the dispatches in server will not be out-of-order since these AMIs are one way.


TIA

OrNot
__________________
Looking for the nails with my favorite hammer, ICE.
-------------------------------------------
Huo.Fei
GE Healthcare
Bin.Li@ge.com
--------------------------------------------
Reply With Quote
  #2 (permalink)  
Old 12-24-2005
marc's Avatar
marc marc is offline
ZeroC Staff
 
Name: Marc Laukien
Organization: ZeroC, Inc.
Project: The Internet Communications Engine
 
Join Date: Feb 2003
Location: Florida
Posts: 1,781
No, an AMI call is inherently twoway. You first send the request, and later receive the response in a callback. If it would be oneway, there would be no response.

Sequential AMI calls, i.e., if you send one AMI call, wait for the callback, then send the next AMI call, are dispatched in order, just like regular twoway calls. Non-sequential AMI calls, i.e., if you send one AMI call after another without first waiting for the first AMI call to complete with a callback, can be dispatched out of order, provided that you use more than one thread in the thread pool.
Reply With Quote
  #3 (permalink)  
Old 12-24-2005
OrNot OrNot is offline
Registered User
 
Name: Bin.Li
Organization: GE Healthcare
Project: Enterprise solution
 
Join Date: Jun 2005
Location: Shanghai
Posts: 157
Send a message via MSN to OrNot
-->
hi,Marc,
Can I understand :
the foo_async() will soon return to the caller thread as soon as it puts the data into the socket stack and without needing the acknowledgment from server, which acts like oneway invocation . That is, the
caller doesn't know the exact time the data is delivered on the wire and the invocation is dispatched in server .
__________________
Looking for the nails with my favorite hammer, ICE.
-------------------------------------------
Huo.Fei
GE Healthcare
Bin.Li@ge.com
--------------------------------------------
Reply With Quote
  #4 (permalink)  
Old 12-24-2005
michi's Avatar
michi michi is offline
ZeroC Staff
 
Name: Michi Henning
Organization: ZeroC
Project: Ice
 
Join Date: Feb 2003
Location: Brisbane, Australia
Posts: 912
Quote:
Originally Posted by OrNot
the foo_async() will soon return to the caller thread as soon as it puts the data into the socket stack and without needing the acknowledgment from server
Right. The Ice run time simply writes the request to the corresponding socket and returns control to the caller immediately. Any errors that might occur when the data is sent or when the reply is unmarshaled are notified via the ice_exception callback.

Quote:
which acts like oneway invocation
Not quite. For a oneway invocation, the caller is not notified of errors whereas, for an AMI invocation, the call is notified of errors.

Quote:
That is, the caller doesn't know the exact time the data is delivered on the wire and the invocation is dispatched in server.
Not really. The request is written immediately. It's just that the reply is delivered asynchronously.

Cheers,

Michi.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT -4. The time now is 11:20 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0
(c) 2008 ZeroC, Inc.