ACE  6.4.2
Public Member Functions | Public Attributes | List of all members
ACE_FIFO_Recv_Msg Class Reference

Receiver side for the record oriented C++ wrapper for UNIX FIFOs. More...

#include <FIFO_Recv_Msg.h>

Inheritance diagram for ACE_FIFO_Recv_Msg:
Inheritance graph
[legend]
Collaboration diagram for ACE_FIFO_Recv_Msg:
Collaboration graph
[legend]

Public Member Functions

 ACE_FIFO_Recv_Msg (void)
 Default constructor. More...
 
 ACE_FIFO_Recv_Msg (const ACE_TCHAR *rendezvous, int flags=O_CREAT|O_RDONLY, mode_t perms=ACE_DEFAULT_FILE_PERMS, int persistent=1, LPSECURITY_ATTRIBUTES sa=0)
 Open up a record-oriented named pipe for reading. More...
 
int open (const ACE_TCHAR *rendezvous, int flags=O_CREAT|O_RDONLY, mode_t perms=ACE_DEFAULT_FILE_PERMS, int persistent=1, LPSECURITY_ATTRIBUTES sa=0)
 Open up a record-oriented named pipe for reading. More...
 
ssize_t recv (ACE_Str_Buf &msg)
 Receive a message based on attributes in an ACE_Str_Buf. More...
 
ssize_t recv (void *buf, size_t len)
 Receive a message based on buffer pointer and maximum size. More...
 
void dump (void) const
 Dump the state of an object. More...
 
- Public Member Functions inherited from ACE_FIFO_Recv
int close (void)
 Close down the fifo. More...
 
ssize_t recv (void *buf, size_t len)
 Recv buf of up to len bytes. More...
 
ssize_t recv_n (void *buf, size_t len)
 Recv buf of exactly len bytes (block until done). More...
 
void dump (void) const
 Dump the state of an object. More...
 
 ACE_FIFO_Recv (void)
 Default constructor. More...
 
 ACE_FIFO_Recv (const ACE_TCHAR *rendezvous, int flags=O_CREAT|O_RDONLY, mode_t perms=ACE_DEFAULT_FILE_PERMS, int persistent=1, LPSECURITY_ATTRIBUTES sa=0)
 Open up a bytestream named pipe for reading. More...
 
int open (const ACE_TCHAR *rendezvous, int flags=O_CREAT|O_RDONLY, mode_t perms=ACE_DEFAULT_FILE_PERMS, int persistent=1, LPSECURITY_ATTRIBUTES sa=0)
 Open up a bytestream named pipe for reading. More...
 
- Public Member Functions inherited from ACE_FIFO
int open (const ACE_TCHAR *rendezvous, int flags, mode_t perms, LPSECURITY_ATTRIBUTES sa=0)
 
int close (void)
 Close down the ACE_FIFO without removing the rendezvous point. More...
 
int remove (void)
 
int get_local_addr (const ACE_TCHAR *&rendezvous) const
 Return the local address of this endpoint. More...
 
void dump (void) const
 Dump the state of an object. More...
 
- Public Member Functions inherited from ACE_IPC_SAP
int control (int cmd, void *) const
 Interface for <ioctl>. More...
 
int enable (int value) const
 
int disable (int value) const
 
ACE_HANDLE get_handle (void) const
 Get the underlying handle. More...
 
void set_handle (ACE_HANDLE handle)
 Set the underlying handle. More...
 
void dump (void) const
 Dump the state of an object. More...
 

Public Attributes

 ACE_ALLOC_HOOK_DECLARE
 Declare the dynamic allocation hooks. More...
 
- Public Attributes inherited from ACE_FIFO_Recv
 ACE_ALLOC_HOOK_DECLARE
 Declare the dynamic allocation hooks. More...
 
- Public Attributes inherited from ACE_FIFO
 ACE_ALLOC_HOOK_DECLARE
 Declare the dynamic allocation hooks. More...
 
- Public Attributes inherited from ACE_IPC_SAP
 ACE_ALLOC_HOOK_DECLARE
 Declare the dynamic allocation hooks. More...
 

Additional Inherited Members

- Protected Member Functions inherited from ACE_FIFO
 ACE_FIFO (void)
 Default constructor. More...
 
 ACE_FIFO (const ACE_TCHAR *rendezvous, int flags, mode_t perms, LPSECURITY_ATTRIBUTES sa=0)
 
- Protected Member Functions inherited from ACE_IPC_SAP
 ACE_IPC_SAP (void)
 Default constructor. More...
 
 ~ACE_IPC_SAP (void)
 Protected destructor. More...
 

Detailed Description

Receiver side for the record oriented C++ wrapper for UNIX FIFOs.

This method works slightly differently on platforms with the ACE_HAS_STREAM_PIPES configuration setting than those without. With ACE_HAS_STREAM_PIPES, the getmsg() system function is used and it preserves message boundaries internally. Without 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.

Constructor & Destructor Documentation

ACE_FIFO_Recv_Msg::ACE_FIFO_Recv_Msg ( void  )

Default constructor.

ACE_FIFO_Recv_Msg::ACE_FIFO_Recv_Msg ( const ACE_TCHAR rendezvous,
int  flags = O_CREAT | O_RDONLY,
mode_t  perms = ACE_DEFAULT_FILE_PERMS,
int  persistent = 1,
LPSECURITY_ATTRIBUTES  sa = 0 
)

Open up a record-oriented named pipe for reading.

Member Function Documentation

void ACE_FIFO_Recv_Msg::dump ( void  ) const

Dump the state of an object.

int ACE_FIFO_Recv_Msg::open ( const ACE_TCHAR rendezvous,
int  flags = O_CREAT | O_RDONLY,
mode_t  perms = ACE_DEFAULT_FILE_PERMS,
int  persistent = 1,
LPSECURITY_ATTRIBUTES  sa = 0 
)

Open up a record-oriented named pipe for reading.

ssize_t ACE_FIFO_Recv_Msg::recv ( ACE_Str_Buf msg)
inline

Receive a message based on attributes in an ACE_Str_Buf.

Parameters
msgReference to an ACE_Str_Buf whose buf member points to the memory to receive the data and maxlen member contains the maximum number of bytes to receive. On return after successfully reading data, the len member contains the number of bytes received and placed in the buffer pointed to by msg.buf.
Return values
-1Error; consult errno for specific error number.
Returns
If the 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 buf.len. The return value from the getmsg() system function is discarded. If 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 msg.maxlen, the return value reflects the entire message length, and the msg.len member reflects how many bytes were actually placed in the caller's buffer. Any part of the message longer than msg.maxlen is discarded.
ssize_t ACE_FIFO_Recv_Msg::recv ( void *  buf,
size_t  len 
)
inline

Receive a message based on buffer pointer and maximum size.

Parameters
bufPointer to the memory to receive the data.
lenThe maximum number of bytes to receive.
Return values
-1Error; consult errno for specific error number.
Returns
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 ACE_HAS_STREAM_PIPES configuration setting. With ACE_HAS_STREAM_PIPES, the return value will be the same as
  • len (this is also possible if the message is exactly the same length as
  • len, and the two cases are indistinguishable). Without ACE_HAS_STREAM_PIPES, the return value is the total length of the message, including bytes in excess of
  • len. The excess bytes are discarded.

Member Data Documentation

ACE_FIFO_Recv_Msg::ACE_ALLOC_HOOK_DECLARE

Declare the dynamic allocation hooks.


The documentation for this class was generated from the following files: