basic_session Class Template Reference
[Network Library]

#include <inetstl/network/session.hpp>

List of all members.


Detailed Description

template<typename C, typename X = throw_internet_exception_policy, typename T = filesystem_traits<C>>
class inetstl::basic_session< C, X, T >

Represents an internet session.

Note:
A session is required for WinInet, as it represents an initialisation of the WinInet libraries

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.

Constructor & Destructor Documentation

basic_session (  )  [inline]

Default constructor.

Note:
A session is created with default arguments

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.

Parameters:
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.
Note:
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 (  )  throw () [inline]

Closes the session, if open.


Member Function Documentation

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.

Parameters:
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.
Note:
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 left in a closed state.

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.

Deprecated:
This will be removed in a future release


The documentation for this class was generated from the following file:

Generated on Thu Jun 10 08:58:28 2010 for STLSoft by  doxygen 1.5.6