#include <inetstl/network/session.hpp>
Public Types | |
typedef C | char_type |
typedef X | exception_policy_type |
typedef exception_policy_type::thrown_type | thrown_type |
typedef T | traits_type |
typedef basic_session< C, X, T > | class_type |
typedef HINTERNET | resource_type |
Public Member Functions | |
basic_session () | |
Default constructor. | |
basic_session (char_type const *pcszAgent, is_dword_t accessType=INTERNET_OPEN_TYPE_PRECONFIG, char_type const *pcszProxyName=NULL, char_type const *pcszProxyBypass=NULL, is_dword_t flags=0) | |
Create a session with the given arguments. | |
~basic_session () throw () | |
Closes the session, if open. | |
bool | open (char_type const *pcszAgent, is_dword_t accessType=INTERNET_OPEN_TYPE_PRECONFIG, char_type const *pcszProxyName=NULL, char_type const *pcszProxyBypass=NULL, is_dword_t flags=0) |
Open a session with the given arguments. | |
void | close () |
Closes the session, if open. | |
HINTERNET | detach () |
Removes the session from this object, and returns the underlying WinInet handle to the caller, who must take responsibility for releasing it. | |
bool | is_open () const |
Indicates whether the object is managing an open session. | |
HINTERNET | get () const |
The underlying WinInet handle. | |
operator HINTERNET () | |
Implicit conversion operator to a WinInet handle. |
basic_session | ( | ) | [inline] |
Default constructor.
If the session fails to initialise, the exception_policy_type function-call operator is called. If the policy throws an exception, then that exception is thrown. If the policy is "null exception" policy type, then the session object will be constructed in a closed state.
basic_session | ( | char_type const * | pcszAgent, | |
is_dword_t | accessType = INTERNET_OPEN_TYPE_PRECONFIG , |
|||
char_type const * | pcszProxyName = NULL , |
|||
char_type const * | pcszProxyBypass = NULL , |
|||
is_dword_t | flags = 0 | |||
) | [inline, explicit] |
Create a session with the given arguments.
pcszAgent | The name of the user agent, e.g. "Acme Internet Browser" | |
accessType | The type of access required, e.g. INTERNET_OPEN_TYPE_DIRECT, INTERNET_OPEN_TYPE_PRECONFIG. Defaults to INTERNET_OPEN_TYPE_PRECONFIG | |
pcszProxyName | The name of the proxy server to use. Defaults to NULL | |
pcszProxyBypass | List of names not be routed by the proxy. Defaults to NULL | |
flags | Flags altering behaviour of the session initialisation. |
~basic_session | ( | ) | throw () [inline] |
Closes the session, if open.
bool open | ( | char_type const * | pcszAgent, | |
is_dword_t | accessType = INTERNET_OPEN_TYPE_PRECONFIG , |
|||
char_type const * | pcszProxyName = NULL , |
|||
char_type const * | pcszProxyBypass = NULL , |
|||
is_dword_t | flags = 0 | |||
) | [inline] |
Open a session with the given arguments.
pcszAgent | The name of the user agent, e.g. "Acme Internet Browser" | |
accessType | The type of access required, e.g. INTERNET_OPEN_TYPE_DIRECT, INTERNET_OPEN_TYPE_PRECONFIG. Defaults to INTERNET_OPEN_TYPE_PRECONFIG | |
pcszProxyName | The name of the proxy server to use. Defaults to NULL | |
pcszProxyBypass | List of names not be routed by the proxy. Defaults to NULL | |
flags | Flags altering behaviour of the session initialisation. |
References basic_session::is_open().
void close | ( | ) | [inline] |
Closes the session, if open.
HINTERNET detach | ( | ) | [inline] |
Removes the session from this object, and returns the underlying WinInet handle to the caller, who must take responsibility for releasing it.
References INETSTL_MESSAGE_ASSERT, and basic_session::is_open().
bool is_open | ( | ) | const [inline] |
Indicates whether the object is managing an open session.
Referenced by basic_session::detach(), and basic_session::open().
HINTERNET get | ( | ) | const [inline] |
The underlying WinInet handle.
operator HINTERNET | ( | ) | [inline] |
Implicit conversion operator to a WinInet handle.