Class: TRequestSenderStream

Declaration: RequestReply.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

TMessageStream

Inherited By:

None.

Purpose:

TRequestSenderStream is the class that a client uses to send requests to, and receive replies from, a server.

Instantiation:

Allocate on the heap or the stack.

Deriving Classes:

Classes may be derived from TRequestSenderStream to define a specific type of protocol for communication. Currently (none). None of the member functions have to be overridden. Derived classes may override Abort to do something more interesting (see Abort). Derived classes may override HandleOpen to add more operation for stream initialization. When overriding HandleOpen, the parent class HandleOpen must be called first. TRequestSenderStream is derived from TMessageStream.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Other Considerations:

None.

Member Function: TRequestSenderStream::TRequestSenderStream

  1. TRequestSenderStream (TServiceReference & serviceReference)
  2. TRequestSenderStream (const TRequestSenderStream & clone)
  3. TRequestSenderStream ()

Interface Category:

API.

Purpose:

  1. Creates a TRequestSenderStream that sends requests to the specified service.
  2. Copy constructor.
  3. Protected, default constructor.

Calling Context:

  1. Called by a client to create a stream to send requests to the specified service.
  2. Called to copy an object.
  3. Called by the derived classes.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TRequestSenderStream::~TRequestSenderStream

virtual ~ TRequestSenderStream ()

Interface Category:

API.

Purpose:

Destructor.

Calling Context:

Called to destroy an object.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TRequestSenderStream::operator=

TRequestSenderStream & operator =(const TRequestSenderStream & clone)

Interface Category:

API.

Purpose:

Assignment operator.

Calling Context:

Called when an object is assigned to another compatible object. Call this function directly.

Parameters:

Return Value:

A non-const reference to the left-hand side object.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TRequestSenderStream::Hash

virtual long Hash () const

Interface Category:

API.

Purpose:

Returns a hash value for this object.

Calling Context:

Called to return a hash value for this object. Call this function directly.

Parameters:

Return Value:

A hash value for this object.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TRequestSenderStream::Send

virtual void Send ()

Interface Category:

API.

Purpose:

Send the buffered data to the underlying communications channel and blocks until a reply is received.

Calling Context:

Called when the application has finished streaming in data and wishes to send the data to the server and await a reply. Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TRequestSenderStream::DoneWithReply

virtual void DoneWithReply ()

Interface Category:

API.

Purpose:

Allows this TRequestSenderStream to release any resources used for the receiving of data and puts the stream into a state which allows the application to start streaming in new data.

Calling Context:

Called when an application has processed all of the reply received. Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TRequestSenderStream::SkipRemainingReply

void SkipRemainingReply ()

Interface Category:

API.

Purpose:

Discards the unread portion of a reply message.

Calling Context:

Called when the client application has read part of a reply message and wishes to discard the remaining data. Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TRequestSenderStream::FlushReply

virtual void FlushReply ()

Interface Category:

API.

Purpose:

Ignores the remainder of the current reply Message and prepares the stream for a new transaction.

Calling Context:

Called to ignore the remainder of the current message and put the stream in a state that allows a new transaction to be initiated. Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TRequestSenderStream::ReturnIfReceiverGoesAway

virtual void ReturnIfReceiverGoesAway ()

Interface Category:

API.

Purpose:

This call will block until the server's task terminates. (currently not operational).

Calling Context:

Called when an application wants to create a thread to detect the termination of the server task. Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TRequestSenderStream::Abort

virtual void Abort ()

Interface Category:

API.

Purpose:

If t is the beginning of a rendezvous, the stream state is put at the initial state and the member functions returns. If it is in the middle of sending a request, it sends an abort and End of message to the peer message stream, which causes that stream to call its member function HandleAbort. If it is at the beginning or in the middle of receiving a reply, the rest of the reply is disposed. In all cases the stream state is put at the initial state.

Calling Context:

Called to abort the current transaction and puts this stream in a state that allows a new transaction to be initiated. Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TRequestSenderStream::HandleOpen

virtual void HandleOpen ()

Interface Category:

API.

Purpose:

A protected member function which causes the desired effects of the member function Open (see MessageStream.d), and throws an exception if the open operation fails.

Calling Context:

Called to open the stream.

Parameters:

Return Value:

None.

Exceptions:

Throws kSetupFailure if the open operation fails.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TRequestSenderStream::HandleAbort

virtual void HandleAbort ()

Interface Category:

API.

Purpose:

A protected member function that handles the receipt of an abort operation from the peer message stream.

Calling Context:

Called when the peer TRequestReceiverStream member function Abort is called. Derive classes may call this member function, it is called internally when Abort is called on the other side of the connection.

Parameters:

Return Value:

None.

Exceptions:

Throws kAbortedByOtherSide to indicate the transaction has been aborted by the peer message stream.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TRequestSenderStream::DoRequestProtocol

virtual void DoRequestProtocol ()

Interface Category:

API.

Purpose:

Allows derived classes defining their own protocol to insert their protocol header at the beginning of a request message. This member function is called once, before any higher level data is streamed out.

Calling Context:

Called to insert the derived class' protocol header at the beginning of a request message.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

Derived classes which add their own protocol should override this member function. The overriding member function should begin its processing by calling the DoRequestProtocol member function of the base class so that the base class' header is processed first.

Member Function: TRequestSenderStream::DoReplyProtocol

virtual void DoReplyProtocol ()

Interface Category:

API.

Purpose:

Allows derived classes defining their own protocol to strip their protocol header from a reply. This member function is called once for each reply message, before higher level data is streamed in.

Calling Context:

Called to strip the derived class' protocol header from the reply message.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

Derived classes which add their own protocol should override this member function. The overriding member function should begin its processing by calling the DoReplyProtocol member function of the base class so that the base class' header is processed first.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.