summaryrefslogtreecommitdiff
path: root/ACE/ace/Name_Request_Reply.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ACE/ace/Name_Request_Reply.cpp')
-rw-r--r--ACE/ace/Name_Request_Reply.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/ACE/ace/Name_Request_Reply.cpp b/ACE/ace/Name_Request_Reply.cpp
index e066b2ef4ac..21424a42d4b 100644
--- a/ACE/ace/Name_Request_Reply.cpp
+++ b/ACE/ace/Name_Request_Reply.cpp
@@ -1,6 +1,9 @@
#include "ace/Name_Request_Reply.h"
+#include "ace/Basic_Types.h"
+#include "ace/CDR_Base.h"
#include "ace/Log_Msg.h"
#include "ace/Time_Value.h"
+#include "ace/Truncate.h"
#include "ace/OS_NS_string.h"
#include "ace/os_include/arpa/os_inet.h"
@@ -185,8 +188,8 @@ ACE_Time_Value
ACE_Name_Request::timeout (void) const
{
ACE_TRACE ("ACE_Name_Request::timeout");
- return ACE_Time_Value (this->transfer_.sec_timeout_,
- this->transfer_.usec_timeout_);
+ time_t sec = ACE_Utils::truncate_cast<time_t> (this->transfer_.sec_timeout_);
+ return ACE_Time_Value (sec, this->transfer_.usec_timeout_);
}
void
@@ -274,7 +277,10 @@ ACE_Name_Request::encode (void *&buf)
buf = (void *) &this->transfer_;
this->transfer_.block_forever_ = ACE_HTONL (this->transfer_.block_forever_);
this->transfer_.usec_timeout_ = ACE_HTONL (this->transfer_.usec_timeout_);
- this->transfer_.sec_timeout_ = ACE_HTONL (this->transfer_.sec_timeout_);
+#if defined (ACE_LITTLE_ENDIAN)
+ ACE_UINT64 secs = this->transfer_.sec_timeout_;
+ ACE_CDR::swap_8 ((const char *)&secs, (char *)&this->transfer_.sec_timeout_);
+#endif
this->transfer_.length_ = ACE_HTONL (this->transfer_.length_);
this->transfer_.msg_type_ = ACE_HTONL (this->transfer_.msg_type_);
this->transfer_.name_len_ = ACE_HTONL (this->transfer_.name_len_);
@@ -294,7 +300,10 @@ ACE_Name_Request::decode (void)
// Decode the fixed-sized portion first.
this->transfer_.block_forever_ = ACE_NTOHL (this->transfer_.block_forever_);
this->transfer_.usec_timeout_ = ACE_NTOHL (this->transfer_.usec_timeout_);
- this->transfer_.sec_timeout_ = ACE_NTOHL (this->transfer_.sec_timeout_);
+#if defined (ACE_LITTLE_ENDIAN)
+ ACE_UINT64 secs = this->transfer_.sec_timeout_;
+ ACE_CDR::swap_8 ((const char *)&secs, (char *)&this->transfer_.sec_timeout_);
+#endif
this->transfer_.length_ = ACE_NTOHL (this->transfer_.length_);
this->transfer_.msg_type_ = ACE_NTOHL (this->transfer_.msg_type_);
this->transfer_.name_len_ = ACE_NTOHL (this->transfer_.name_len_);