summaryrefslogtreecommitdiff
path: root/ace/FIFO_Recv_Msg.h
diff options
context:
space:
mode:
authorSteve Huston <shuston@riverace.com>2002-08-22 21:36:20 +0000
committerSteve Huston <shuston@riverace.com>2002-08-22 21:36:20 +0000
commitc5c8c704703b8d5d176c8f3995baa6a27da19d84 (patch)
tree4d84d8ef233363408e5ebacc70913c1c8f8d5544 /ace/FIFO_Recv_Msg.h
parent4543cbb11424ebd435470e2ad902fec12ffa33a1 (diff)
downloadATCD-c5c8c704703b8d5d176c8f3995baa6a27da19d84.tar.gz
ChangeLogTag:Thu Aug 22 17:34:18 2002 Steve Huston <shuston@riverace.com>
Diffstat (limited to 'ace/FIFO_Recv_Msg.h')
-rw-r--r--ace/FIFO_Recv_Msg.h54
1 files changed, 52 insertions, 2 deletions
diff --git a/ace/FIFO_Recv_Msg.h b/ace/FIFO_Recv_Msg.h
index 3920e063630..493ab63e436 100644
--- a/ace/FIFO_Recv_Msg.h
+++ b/ace/FIFO_Recv_Msg.h
@@ -25,6 +25,17 @@
* @class ACE_FIFO_Recv_Msg
*
* @brief Receiver side for the record oriented C++ wrapper for UNIX FIFOs.
+ *
+ * This method works slightly differently on platforms with the
+ * @c ACE_HAS_STREAM_PIPES configuration setting than those without.
+ * With ACE_HAS_STREAM_PIPES, the @c getmsg() system function is used
+ * and it preserves message boundaries internally. Without
+ * @c ACE_HAS_STREAM_PIPES, the message boundaries are emulated by
+ * this class and ACE_FIFO_Send_Msg cooperating. The sending class
+ * first writes an integer number of bytes in the message, then the
+ * message. ACE_FIFO_Recv_Msg reads the count, then the data.
+ * The operational differences occur primarily when a message is larger
+ * than what a caller of this class requests. See recv() for details.
*/
class ACE_Export ACE_FIFO_Recv_Msg : public ACE_FIFO_Recv
{
@@ -47,10 +58,49 @@ public:
int persistent = 1,
LPSECURITY_ATTRIBUTES sa = 0);
- /// Recv <msg> as an ACE_Str_Buf.
+ /// Receive a message based on attributes in an ACE_Str_Buf.
+ /**
+ * @param msg Reference to an ACE_Str_Buf whose @c buf member points
+ * to the memory to receive the data and @c maxlen member
+ * contains the maximum number of bytes to receive.
+ * On return after successfully reading data, the
+ * @c len member contains the number of bytes received and
+ * placed in the buffer pointed to by @c msg.buf.
+ *
+ * @retval -1 Error; consult @c errno for specific error number.
+ * @return If the @c ACE_HAS_STREAM_PIPES configuration setting is
+ * defined, the return value is the number of bytes received
+ * in the message and will be the same as @c buf.len.
+ * The return value from the @c getmsg() system function
+ * is discarded.
+ * If @c ACE_HAS_STREAM_PIPES is not defined, the number
+ * of bytes in the message read from the FIFO is returned.
+ * If the message is larger than the maximum length
+ * requested in @c msg.maxlen, the return value reflects
+ * the entire message length, and the @c msg.len member
+ * reflects how many bytes were actually placed in the
+ * caller's buffer. Any part of the message longer than
+ * @c msg.maxlen is discarded.
+ */
ssize_t recv (ACE_Str_Buf &msg);
- /// Recv <msg> as a buffer.
+ /// Receive a message based on buffer pointer and maximum size.
+ /**
+ * @param buf Pointer to the memory to receive the data.
+ * @param len The maximum number of bytes to receive.
+ *
+ * @retval -1 Error; consult @c errno for specific error number.
+ * @return The number of bytes received in the message. For messages
+ * that are larger than the requested maximum size, the
+ * behavior is different depending on the @c ACE_HAS_STREAM_PIPES
+ * configuration setting. With @c ACE_HAS_STREAM_PIPES,
+ * the return value will be the same as @arg len (this is
+ * also possible if the message is exactly the same length
+ * as @arg len, and the two cases are indistinguishable).
+ * Without @c ACE_HAS_STREAM_PIPES, the return value is
+ * the total length of the message, including bytes in
+ * excess of @arg len. The excess bytes are discarded.
+ */
ssize_t recv (void *buf, size_t len);
#if defined (ACE_HAS_STREAM_PIPES)