3 //=============================================================================
5 * @file Time_Request_Reply.h
7 * Define the format used to exchange messages between the
8 * ACE time server and clerks.
10 * @author Prashant Jain
12 //=============================================================================
15 #ifndef ACE_TIME_REQUEST_REPLY_H
16 #define ACE_TIME_REQUEST_REPLY_H
17 #include /**/ "ace/pre.h"
19 #include "ace/Time_Value.h"
20 #include "ace/svc_export.h"
22 #if !defined (ACE_LACKS_PRAGMA_ONCE)
24 #endif /* ACE_LACKS_PRAGMA_ONCE */
27 * @class ACE_Time_Request
29 * @brief Message format for delivering requests to the ACE_Time Server.
31 * This class is implemented to minimize data copying.
32 * In particular, all marshaling is done in situ...
34 class ACE_Svc_Export ACE_Time_Request
39 /// Request message types.
42 /// Class-specific constant values.
43 MAX_TIME_LEN
= MAXPATHLEN
+ 1
46 /// Default constructor.
50 * Create a ACE_Time_Request message.
51 * @param msg_type Type of request.
53 * @param timeout Max time waiting for request.
55 ACE_Time_Request (ACE_INT32 msg_type
,
57 ACE_Time_Value
*timeout
= 0);
59 // Get the fixed size of message
60 ssize_t
size () const;
62 /// Get the type of the message.
63 ACE_INT32
msg_type () const;
65 /// Set the type of the message.
66 void msg_type (ACE_INT32
);
74 /// Get the blocking semantics.
75 ACE_UINT32
block_forever () const;
77 /// Set the blocking semantics.
78 void block_forever (ACE_UINT32
);
81 ACE_Time_Value
timeout () const;
84 void timeout (const ACE_Time_Value
& timeout
);
86 /// Encode the message before transmission.
89 /// Decode message after reception.
92 /// Print out the values of the message for debugging purposes.
96 // = The 5 fields in the <Transfer> struct are transmitted to the server.
97 // The remaining 2 fields are not tranferred -- they are used only on
98 // the server-side to simplify lookups.
102 /// Type of the request (i.e., <TIME_UPDATE>)
105 /// Indicates if we should block forever. If 0, then sec_timeout_
106 /// and usec_timeout_ indicates how long we should wait.
107 ACE_UINT32 block_forever_
;
109 /// Max seconds willing to wait for name if not blocking forever.
110 ACE_UINT64 sec_timeout_
;
112 /// Max micro seconds to wait for name if not blocking forever.
113 ACE_UINT32 usec_timeout_
;
115 /// The data portion contains <time_>
126 #include /**/ "ace/post.h"
127 #endif /* ACE_TIME_REQUEST_REPLY_H */