summaryrefslogtreecommitdiff
path: root/ace/Pipe.cpp
diff options
context:
space:
mode:
authorlevine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-05-06 19:26:46 +0000
committerlevine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-05-06 19:26:46 +0000
commit60c76211507a42019c07cfc60c3d0830e7c682c0 (patch)
tree275975679c42055ff2eebd611d3e46748c64a963 /ace/Pipe.cpp
parent8893ac303967ab76460f381617a656f192897aea (diff)
downloadATCD-60c76211507a42019c07cfc60c3d0830e7c682c0.tar.gz
(open): added support for ACE_LACKS_TCP_NODELAY
Diffstat (limited to 'ace/Pipe.cpp')
-rw-r--r--ace/Pipe.cpp22
1 files changed, 12 insertions, 10 deletions
diff --git a/ace/Pipe.cpp b/ace/Pipe.cpp
index e4f52a891f3..fa25315f78f 100644
--- a/ace/Pipe.cpp
+++ b/ace/Pipe.cpp
@@ -1,4 +1,3 @@
-// Pipe.cpp
// $Id$
#define ACE_BUILD_DLL
@@ -43,15 +42,15 @@ ACE_Pipe::open (void)
{
ACE_INET_Addr sv_addr (my_addr.get_port_number (),
ASYS_TEXT ("localhost"));
-
+
// Establish a connection within the same process.
if (connector.connect (writer, sv_addr) == -1)
- result = -1;
+ result = -1;
else if (acceptor.accept (reader) == -1)
- {
- writer.close ();
- result = -1;
- }
+ {
+ writer.close ();
+ result = -1;
+ }
}
// Close down the acceptor endpoint since we don't need it anymore.
@@ -60,12 +59,15 @@ ACE_Pipe::open (void)
return -1;
int one = 1;
+
+#ifndef ACE_LACKS_TCP_NODELAY
// Make sure that the TCP stack doesn't try to buffer small writes.
// Since this communication is purely local to the host it doesn't
// affect network performance.
if (writer.set_option (IPPROTO_TCP, TCP_NODELAY,
- &one, sizeof one) == -1)
+ &one, sizeof one) == -1)
return -1;
+#endif /* ACE_LACKS_TCP_NODELAY */
this->handles_[0] = reader.get_handle ();
this->handles_[1] = writer.get_handle ();
@@ -135,8 +137,8 @@ ACE_Pipe::ACE_Pipe (ACE_HANDLE handles[2])
ASYS_TEXT ("ACE_Pipe::ACE_Pipe")));
}
-ACE_Pipe::ACE_Pipe (ACE_HANDLE read,
- ACE_HANDLE write)
+ACE_Pipe::ACE_Pipe (ACE_HANDLE read,
+ ACE_HANDLE write)
{
ACE_TRACE ("ACE_Pipe::ACE_Pipe");
this->handles_[0] = read;