1 // $Id: SPIPE.cpp 80826 2008-03-04 14:51:23Z wotte $
5 #include "ace/OS_NS_unistd.h"
7 #if !defined (__ACE_INLINE__)
8 #include "ace/SPIPE.inl"
9 #endif /* __ACE_INLINE__ */
11 ACE_RCSID(ace
, SPIPE
, "$Id: SPIPE.cpp 80826 2008-03-04 14:51:23Z wotte $")
13 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
15 ACE_ALLOC_HOOK_DEFINE(ACE_SPIPE
)
17 // This is the do-nothing constructor.
19 ACE_SPIPE::ACE_SPIPE (void)
21 // ACE_TRACE ("ACE_SPIPE::ACE_SPIPE");
25 ACE_SPIPE::dump (void) const
27 #if defined (ACE_HAS_DUMP)
28 ACE_TRACE ("ACE_SPIPE::dump");
29 #endif /* ACE_HAS_DUMP */
32 // Close down a ACE_SPIPE.
35 ACE_SPIPE::get_local_addr (ACE_SPIPE_Addr
&local_sap
) const
37 ACE_TRACE ("ACE_SPIPE::get_local_addr");
38 local_sap
= this->local_addr_
;
42 // Close down the STREAM pipe without removing the rendezvous point.
45 ACE_SPIPE::close (void)
47 ACE_TRACE ("ACE_SPIPE::close");
50 if (this->get_handle () != ACE_INVALID_HANDLE
)
52 result
= ACE_OS::close (this->get_handle ());
53 #if defined (ACE_HAS_STREAM_PIPES)
54 result
= (ACE_OS::close (duplex_pipe_handle_
) || result
);
55 #endif /* ACE_HAS_STREAM_PIPES */
56 this->set_handle (ACE_INVALID_HANDLE
);
61 // Close down the STREAM pipe and remove the rendezvous point from the
65 ACE_SPIPE::remove (void)
67 ACE_TRACE ("ACE_SPIPE::remove");
68 int result
= this->close ();
69 return ACE_OS::unlink (this->local_addr_
.get_path_name ()) == -1 || result
== -1 ? -1 : 0;
72 #if defined (ACE_HAS_STREAM_PIPES)
73 /// Temporary store of duplex pipe handle.
75 ACE_SPIPE::set_duplex_handle (ACE_HANDLE handle
)
77 ACE_TRACE ("ACE_SPIPE::set_duplex_handle");
78 this->duplex_pipe_handle_
= handle
;
80 #endif /* ACE_HAS_STREAM_PIPES */
82 ACE_END_VERSIONED_NAMESPACE_DECL