Use a variable on the stack to not have a temporary in the call
[ACE_TAO.git] / ACE / protocols / ace / INet / HTTP_Session.h
blob784f6073373895b682d6b65e79e9b82565f0062b
1 /**
2 * @file HTTP_Session.h
4 * @author Martin Corino <mcorino@remedy.nl>
5 */
7 #ifndef ACE_HTTP_SESSION_H
8 #define ACE_HTTP_SESSION_H
10 #include /**/ "ace/pre.h"
12 #include "ace/INet/HTTP_SessionBase.h"
13 #include "ace/SOCK_Connector.h"
14 #include "ace/INet/StreamHandler.h"
15 #include "ace/INet/Sock_IOStream.h"
17 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
19 namespace ACE
21 namespace HTTP
23 /**
24 * @class ACE_HTTP_Session
26 * @brief Encapsulates HTTP session.
29 template <ACE_SYNCH_DECL>
30 class Session_T : public SessionBase
32 public:
33 typedef ACE::IOS::StreamHandler<ACE_SOCK_STREAM, ACE_SYNCH_USE> connection_type;
35 Session_T (bool keep_alive = false);
37 Session_T (const ACE_Time_Value& timeout,
38 bool keep_alive = false,
39 const ACE_Time_Value* alive_timeout = 0);
41 virtual ~Session_T ();
43 virtual bool is_connected () const;
45 bool attach_connection (connection_type* connection);
47 protected:
48 void close_connection ();
50 virtual bool connect_i (const ACE_Synch_Options& sync_opt);
52 virtual void close_i ();
54 virtual std::iostream& sock_stream ();
56 private:
57 typedef ACE::IOS::Sock_IOStreamBase<ACE_SYNCH_USE> sock_stream_type;
59 connection_type* connection_;
60 sock_stream_type* sock_stream_;
63 typedef Session_T<ACE_NULL_SYNCH> Session;
67 ACE_END_VERSIONED_NAMESPACE_DECL
69 #include "ace/INet/HTTP_Session.cpp"
71 #include /**/ "ace/post.h"
72 #endif /* ACE_HTTP_SESSION_H */