Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

IPC::TwoWayMsg Class Reference

This class allows for two-way communication. More...

#include <ipcplus.h>

Inheritance diagram for IPC::TwoWayMsg::

IPC::MsgClient IPC::MsgServer List of all members.

Public Methods

 TwoWayMsg (const unsigned int key0)
 Constructs a double Sys V IPC queue. More...

virtual ~TwoWayMsg ()
 Destructor. More...

virtual bool destroy ()
 Destroys the system queues. More...

virtual bool xmitReq (const void *data, const size_t size, const int mType=1)
 Transmit a request. More...

virtual bool xmitRep (const void *data, const size_t size, const int mType=1)
 Transmit a reply. More...

virtual bool recvReq (void *mData, size_t &mSize, const int mType=1)
 Receive a request. More...

virtual bool recvRep (void *mData, size_t &mSize, const int mType=1)
 Receive a reply. More...


Protected Attributes

Msgreq
 The send and receive queues.

Msgrep
 The send and receive queues.


Detailed Description

This class allows for two-way communication.

Two message queues are used to avoid deadlocks. Co-operating processes should use one queue to transmit "requests" and the other queue to receive "replies".


Constructor & Destructor Documentation

IPC::TwoWayMsg::TwoWayMsg const unsigned int    key0 [inline]
 

Constructs a double Sys V IPC queue.

Parameters:
key0  Will be the transmit queue and key0 + 1 will be the receive queue.

virtual IPC::TwoWayMsg::~TwoWayMsg   [inline, virtual]
 

Destructor.

Does not delete the system queues themselves.

Also see destroy().


Member Function Documentation

virtual bool IPC::TwoWayMsg::destroy   [inline, virtual]
 

Destroys the system queues.

After destroy () has been called the class becomes inoperative.

Returns:
False if either of the sub-destroys failed.

virtual bool IPC::TwoWayMsg::recvRep void *    mData,
size_t &    mSize,
const int    mType = 1
[inline, virtual]
 

Receive a reply.

Parameters:
mData  Must be a pointer to a buffer of the correct size.
mSize  Will hold the number of bytes received.
mType  Must be a positive integer.
Returns:
False if this didn't work.

virtual bool IPC::TwoWayMsg::recvReq void *    mData,
size_t &    mSize,
const int    mType = 1
[inline, virtual]
 

Receive a request.

Parameters:
mData  Must be a pointer to a buffer of the correct size.
mSize  Will hold the number of bytes received.
mType  Must be a positive integer.
Returns:
False if this didn't work.

virtual bool IPC::TwoWayMsg::xmitRep const void *    data,
const size_t    size,
const int    mType = 1
[inline, virtual]
 

Transmit a reply.

Parameters:
data  The bytes to send.
size  The number of bytes to send.
mType  Optionally a priority or message type may be specified. This must be a positive integer.
Returns:
False if this didn't work.

virtual bool IPC::TwoWayMsg::xmitReq const void *    data,
const size_t    size,
const int    mType = 1
[inline, virtual]
 

Transmit a request.

Parameters:
data  The bytes to send.
size  The number of bytes to send.
mType  Optionally a priority or message type may be specified. This must be a positive integer.
Returns:
False if this didn't work.


The documentation for this class was generated from the following file:
Generated on Wed May 15 09:33:33 2002 for IPCPlus by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001