1 #include "ace/FIFO_Send_Msg.h"
3 #include "ace/Log_Category.h"
4 #include "ace/OS_NS_sys_uio.h"
5 #if defined (ACE_HAS_ALLOC_HOOKS)
6 # include "ace/Malloc_Base.h"
7 #endif /* ACE_HAS_ALLOC_HOOKS */
9 #if !defined (__ACE_INLINE__)
10 #include "ace/FIFO_Send_Msg.inl"
11 #endif /* __ACE_INLINE__ */
13 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
15 ACE_ALLOC_HOOK_DEFINE(ACE_FIFO_Send_Msg
)
18 ACE_FIFO_Send_Msg::dump () const
20 #if defined (ACE_HAS_DUMP)
21 ACE_TRACE ("ACE_FIFO_Send_Msg::dump");
22 ACE_FIFO_Send::dump ();
23 #endif /* ACE_HAS_DUMP */
27 ACE_FIFO_Send_Msg::send (const ACE_Str_Buf
&send_msg
)
29 // ACE_TRACE ("ACE_FIFO_Send_Msg::send");
30 #if defined (ACE_HAS_STREAM_PIPES)
31 if (ACE_OS::putmsg (this->get_handle (),
41 iov
[0].iov_base
= (char *) &send_msg
.len
;
42 iov
[0].iov_len
= sizeof send_msg
.len
;
44 iov
[1].iov_base
= (char *) send_msg
.buf
;
45 iov
[1].iov_len
= static_cast<u_long
> (send_msg
.len
);
47 ssize_t sent
= ACE_OS::writev (this->get_handle (), iov
, 2);
49 sent
-= iov
[0].iov_len
; // Don't count the length we added.
51 #endif /* ACE_HAS_STREAM_PIPES */
54 ACE_FIFO_Send_Msg::ACE_FIFO_Send_Msg ()
56 // ACE_TRACE ("ACE_FIFO_Send_Msg::ACE_FIFO_Send_Msg");
60 ACE_FIFO_Send_Msg::open (const ACE_TCHAR
*fifo_name
,
63 LPSECURITY_ATTRIBUTES sa
)
65 ACE_TRACE ("ACE_FIFO_Send_Msg::open");
66 return ACE_FIFO_Send::open (fifo_name
, flags
| O_WRONLY
, perms
, sa
);
69 ACE_FIFO_Send_Msg::ACE_FIFO_Send_Msg (const ACE_TCHAR
*fifo_name
,
72 LPSECURITY_ATTRIBUTES sa
)
74 ACE_TRACE ("ACE_FIFO_Send_Msg::ACE_FIFO_Send_Msg");
75 if (this->ACE_FIFO_Send_Msg::open (fifo_name
, flags
, perms
, sa
) == -1)
76 ACELIB_ERROR ((LM_ERROR
, ACE_TEXT ("%p\n"), ACE_TEXT ("ACE_FIFO_Send_Msg")));
79 ACE_END_VERSIONED_NAMESPACE_DECL