#include <FConnection.h>
Collaboration diagram for FConnection:
Public Member Functions | |
virtual | ~FConnection () |
Destructor. Closes the connection and the session. | |
const int | startConnection () |
Starts a new GPRS connection using the default IAP, which name is stored in the member 'iIAPDefaultName'. | |
const int | startConnection (const StringBuffer &aIAPName) |
Starts a new GPRS connection, given the IAP name. | |
void | closeConnection () |
Closes the active connection. | |
const int | stopConnection () |
Stops the entire connection by disconnecting the underlying network interface immediately, regardless of whether other clients are using it or not. | |
const bool | isConnected () |
Checks if the connection is active or down. | |
const StringBuffer & | getLocalIpAddress () |
Returns the local IP address of the device. | |
void | setIAPName (const StringBuffer &aIAPName) |
Sets the IAP name, that will be used in startConnection(). | |
StringBuffer & | getIAPName () |
Returns the current IAP name. | |
RArray< HBufC * > | GetAllIAPNames () |
Returns an array of (new allocated) descriptors, with all the current IAP names. | |
RConnection * | getConnection () |
Returns a pointer to the (internally owned) RConnection. | |
RSocketServ * | getSession () |
Returns a pointer to the (internally owned) SocketServ. | |
TInt | getLastError () |
Returns the last error code. | |
Static Public Member Functions | |
static FConnection * | getInstance () |
Method to get the sole instance of FConnection. | |
static void | dispose () |
Method to destroy the instance of FConnection. | |
Protected Member Functions | |
FConnection () | |
Default constructor. |
Get the only instance of FConnection calling FConnection::getInstance(). Owns the RSocketServ and RConnection of the current connection, that can be used exterally calling getConnection() and getSession().
const int FConnection::startConnection | ( | ) |
Starts a new GPRS connection using the default IAP, which name is stored in the member 'iIAPDefaultName'.
The method setIAPDefaultName() should be called before this method, to set the IAP to be used - otherwise, the user will be prompted to select the IAP.
const int FConnection::startConnection | ( | const StringBuffer & | aIAPName | ) |
Starts a new GPRS connection, given the IAP name.
aIAPName | "Ask" or "" : if we want to prompt the user to select the IAP "Default" : will use the default IAP of the system, no prompts "<name>" : will use the <name> IAP, no prompts. If not found, will prompt the user to select the IAP |
void FConnection::closeConnection | ( | ) |
Closes the active connection.
The connection will not be dropped immediately: it will be dropped when there is no more data traffic on the connection.
const int FConnection::stopConnection | ( | ) |
Stops the entire connection by disconnecting the underlying network interface immediately, regardless of whether other clients are using it or not.
Applications using the connection will be sent the socket error code KErrCancel.
const bool FConnection::isConnected | ( | ) |
Checks if the connection is active or down.
Between active connection, we search for the one started with startConnection().
const StringBuffer& FConnection::getLocalIpAddress | ( | ) |
Returns the local IP address of the device.
TODO
void FConnection::setIAPName | ( | const StringBuffer & | aIAPName | ) | [inline] |
Sets the IAP name, that will be used in startConnection().
This method should be called at the beginning, so that subsequent calls to startConnection() will use this IAP.
aIAPName | the name of the IAP |
RArray<HBufC*> FConnection::GetAllIAPNames | ( | ) |
Returns an array of (new allocated) descriptors, with all the current IAP names.
The caller has the ownership of the array, so he should take care of deleting it (calling Close()).