Next: Receiving a request
Up: RequestCorrelator
Previous: RequestCorrelator
The caller creates a new instance of RspCollector and invokes SendRequest with a unique ID that it wants to assign to the request, a
message and the response collector. All the messages received for that
specific request will be directed towards the response collector. If it
is null, this means that the request is sent one-way, and no responses
are to be returned. If it is not null, it is added to a response
collector table.
SendRequest adds a specific header to the message and uses the
underlying transport's Send method to send the message to its
destination(s). The header contains
- 1.
- The ID assigned to the request by the caller
- 2.
- The type. A type can only be a request or a response.
- 3.
- Whether a response is expected or not. This is determined by SendRequest: if a non-null response collector is given as
argument, this field will be true, otherwise false. The receiver of
a request can thus determine whether to return a response.
- 4.
- A name that is associated with this specific instance of request
correlator. Every request correlator has a unique name. When
removing the header from a message, it is checked whether the
header is of type RequestCorrelatorHeader and whether the
current request correlator's name matches the one in the
header. Only if both conditions are true, the message is
processed. Otherwise, it is rejected (Receive returns
false).
The message's destination field determines whether a unicast or multicast
message will be sent, i.e. whether the message will be sent to a single
member (destination field contains a member address) or to all group
members (destination field is null).
Next: Receiving a request
Up: RequestCorrelator
Previous: RequestCorrelator
1999-12-13