#include <inetstl/network/connection.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_connection< C, X, T > | class_type |
| typedef HINTERNET | resource_type |
Public Member Functions | |
| basic_connection () | |
| Default constructor. | |
| basic_connection (HINTERNET hsess, char_type const *server, INTERNET_PORT port, char_type const *userName, char_type const *password, is_dword_t service, is_dword_t flags, is_dword_t context=0) | |
| Create a connection with the given arguments. | |
| ~basic_connection () throw () | |
| Closes the connection, if open. | |
| bool | connect (HINTERNET hsess, char_type const *server, INTERNET_PORT port, char_type const *userName, char_type const *password, is_dword_t service, is_dword_t flags, is_dword_t context=0) |
| Opens a connection with the given arguments. | |
| void | close () |
| Closes the connection, if open. | |
| HINTERNET | detach () |
| Removes the connection from this object, and returns the underlying WinInet handle to the caller, who must take responsibility for releasing it. | |
| bool | is_connected () const |
| Indicates whether the object is managing an open connection. | |
| is_dword_t | last_error () const |
| The last Win32/WinInet error associated with this connection object. | |
| HINTERNET | get () const |
| The underlying WinInet handle. | |
| operator HINTERNET () | |
| Implicit conversion operator to a WinInet handle. | |
| basic_connection | ( | ) | [inline] |
| basic_connection | ( | HINTERNET | hsess, | |
| char_type const * | server, | |||
| INTERNET_PORT | port, | |||
| char_type const * | userName, | |||
| char_type const * | password, | |||
| is_dword_t | service, | |||
| is_dword_t | flags, | |||
| is_dword_t | context = 0 | |||
| ) | [inline, explicit] |
Create a connection with the given arguments.
| hsess | A WinInet handle to the current session, obtained via InternetOpen() or the basic_session class | |
| server | The name of the server to which to connect. May not be NULL | |
| port | The number of the port to connect on | |
| userName | The username for the connection. May be NULL | |
| password | The password for the connection. May be NULL | |
| service | The service to access. Either INTERNET_SERVICE_FTP or INTERNET_SERVICE_HTTP | |
| flags | Service specific flags, e.g. INTERNET_FLAG_PASSIVE | |
| context | Context used for callback functions |
| ~basic_connection | ( | ) | throw () [inline] |
Closes the connection, if open.
| bool connect | ( | HINTERNET | hsess, | |
| char_type const * | server, | |||
| INTERNET_PORT | port, | |||
| char_type const * | userName, | |||
| char_type const * | password, | |||
| is_dword_t | service, | |||
| is_dword_t | flags, | |||
| is_dword_t | context = 0 | |||
| ) | [inline] |
Opens a connection with the given arguments.
| hsess | A WinInet handle to the current session, obtained via InternetOpen() or the basic_session class | |
| server | The name of the server to which to connect. May not be NULL | |
| port | The number of the port to connect on | |
| userName | The username for the connection. May be NULL | |
| password | The password for the connection. May be NULL | |
| service | The service to access. Either INTERNET_SERVICE_FTP or INTERNET_SERVICE_HTTP | |
| flags | Service specific flags, e.g. INTERNET_FLAG_PASSIVE | |
| context | Context used for callback functions |
References basic_connection::is_connected().
| void close | ( | ) | [inline] |
Closes the connection, if open.
| HINTERNET detach | ( | ) | [inline] |
Removes the connection 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_connection::is_connected().
| bool is_connected | ( | ) | const [inline] |
Indicates whether the object is managing an open connection.
Referenced by basic_connection::connect(), and basic_connection::detach().
| is_dword_t last_error | ( | ) | const [inline] |
The last Win32/WinInet error associated with this connection object.
| HINTERNET get | ( | ) | const [inline] |
The underlying WinInet handle.
| operator HINTERNET | ( | ) | [inline] |
Implicit conversion operator to a WinInet handle.
1.5.6