* method represents a request for the DNS host information for an IP address. Both requests can be made in an asynchronous mode.
*
* For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/net/domain_name_system_access.htm">Domain Name System Access</a>.
+ *
+ * The following example demonstrates how to use the %Dns class.
+ *
+ * @code
+ *
+ * #include <FBase.h>
+ * #include <FNet.h>
+ *
+ * using namespace Tizen::Base;
+ * using namespace Tizen::Base::Collection;
+ * using namespace Tizen::Net;
+ *
+ * class MyClass
+ * : public Object
+ * , public IDnsEventListener
+ * {
+ * public:
+ * MyClass(void) {}
+ * ~MyClass(void) {}
+ *
+ * // IDnsEventListener
+ * void OnDnsResolutionCompletedN(IpHostEntry* pIpHostEntry, result r);
+ *
+ * void GetHostByName(void);
+ * };
+ *
+ * void
+ * MyClass::OnDnsResolutionCompletedN(IpHostEntry* pIpHostEntry, result r)
+ * {
+ * if (pIpHostEntry == null)
+ * {
+ * return;
+ * }
+ *
+ * IList* pAddressList = pIpHostEntry->GetAddressList();
+ * if (pAddressList != null)
+ * {
+ * int count = pAddressList->GetCount();
+ *
+ * for (int i = 0; i<count; i++)
+ * {
+ * IpAddress* pIpAddress = (IpAddress*)(pAddressList->GetAt(i));
+ * AppLog("IpAddress no.%d = [%ls]\n", i, pIpAddress->ToString().GetPointer());
+ * }
+ * }
+ *
+ * IList* pAliasList = pIpHostEntry->GetAliasList();
+ * if (pAliasList != null)
+ * {
+ * int count = pAliasList->GetCount();
+ *
+ * for (int i = 0; i<count; i++)
+ * {
+ * String* pAlias = (String*)(pAliasList->GetAt(i));
+ * AppLog("Alias no.%d = [%ls]\n", i, pAlias->GetPointer());
+ * }
+ * }
+ *
+ * delete pIpHostEntry;
+ * }
+ *
+ * void
+ * MyClass::GetHostByName(void)
+ * {
+ * Dns* pDns = new Dns();
+ * result r = pDns->Construct(*this);
+ * if (IsFailed(r))
+ * {
+ * delete pDns;
+ * return;
+ * }
+ *
+ * r = pDns->GetHostByName(L"www.tizen.org");
+ *
+ * // Wait OnDnsResolutionCompletedN() event
+ *
+ * delete pDns;
+ * }
+ *
+ * @endcode
*/
class _OSP_EXPORT_ Dns
: public Tizen::Base::Object
*
* For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/net/domain_name_system_access.htm">Domain Name System Access</a>.
*
- * @see Tizen::Net::IpHostEntry
- *
- * The following example demonstrates how to use the %IDnsEventListener interface.
- *
- * @code
- *
- * using namespace Tizen::Net;
- *
- * class MyDnsListener
- * : public IDnsEventListener
- * {
- * public:
- * void OnDnsResolutionCompletedN(IpHostEntry* ipHostEntry, result r);
- * };
- *
- * void
- * MyDnsListener::OnDnsResolutionCompletedN(IpHostEntry* ipHostEntry, result r)
- * {
- * if (ipHostEntry == null)
- * {
- * AppLog("error case no.%d \n", r);
- * }
- * else
- * {
- * Tizen::Base::Collection::IList* addressList = ipHostEntry->GetAddressList();
- *
- * if (addressList != null)
- * {
- * int count = addressList->GetCount();
- *
- * for (int i = 0; i < count; i++)
- * {
- * IpAddress* pIpAddress = (IpAddress*)(addressList->GetAt(i));
- * Tizen::Base::ByteBuffer*_pbb = Tizen::Base::Utility::StringUtil::StringToUtf8N(pIpAddress->ToString());
- *
- * AppLog("IpAddress no.%d : %s\n", i, (char*)(_pbb->GetPointer()));
- * delete _pbb;
- * }
- * }
- *
- * Tizen::Base::Collection::IList* aliasList = ipHostEntry->GetAliasList();
- *
- * if (aliasList != null)
- * {
- * int count = aliasList->GetCount();
- *
- * for (int i = 0; i < count; i++)
- * {
- * String* alias = (String*)(aliasList->GetAt(i));
- * Tizen::Base::ByteBuffer*_pbb = Tizen::Base::Utility::StringUtil::StringToUtf8N(*alias);
- *
- * AppLog("alias no.%d : %s\n", i, (char*)(_pbb->GetPointer()));
- * delete _pbb;
- * }
- * }
- * delete ipHostEntry;
- * }
- * }
- *
- * @endcode
- *
+ * @see IpHostEntry
*/
class _OSP_EXPORT_ IDnsEventListener
: virtual public Tizen::Base::Runtime::IEventListener
*
* For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/net/local_DHCP_server_access.htm">Local DHCP Server Access</a>.
*
- * @see Tizen::Net::DhcpClientInfo
+ * @see DhcpClientInfo
*/
class _OSP_EXPORT_ ILocalDhcpServerEventListener
: virtual public Tizen::Base::Runtime::IEventListener
* NetConnection::AddNetConnectionListener() method. When a network connection event is generated, a method of this class is called.
*
* For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/net/managing_network_connections.htm">Managing Network Connections</a>.
- *
- * The following example demonstrates how to use the %INetConnectionEventListener interface.
- *
- * @code
-using namespace Tizen::Net;
-using namespace Tizen::Base;
-
-class TestListener
- : public Object
- , public virtual INetConnectionEventListener
-{
-public:
- TestListener() {}
-
- ~TestListener() {}
-
- void OnNetConnectionStarted(NetConnection& netConnection, result r)
- {
- AppLog("OnStarted\n");
- }
-
- void OnNetConnectionStopped(NetConnection& netConnection, result r)
- {
- AppLog("OnStopped\n");
- }
-
- void OnNetConnectionSuspended(NetConnection& netConnection)
- {
- AppLog("OnSuspended\n");
- }
-
- void OnNetConnectionResumed(NetConnection& netConnection)
- {
- AppLog("OnResumed\n");
- }
-};
- * @endcode
*/
class _OSP_EXPORT_ INetConnectionEventListener
: virtual public Tizen::Base::Runtime::IEventListener
* with the Dns class.
*
* For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/net/domain_name_system_access.htm">Domain Name System Access</a>.
- *
- * The following example demonstrates how to use the %IpHostEntry class.
- *
- * @code
-class MyDnsListener
- : public IDnsEventListener
-{
-public:
- void OnDnsResolutionCompletedN(IpHostEntry* ipHostEntry, result r);
-};
-
-
-void
-MyDnsListener::OnDnsResolutionCompletedN(IpHostEntry* ipHostEntry, result r)
-{
- if (ipHostEntry == null)
- {
- AppLog("error case no.%d \n", r);
- }
- else
- {
- Tizen::Base::Collection::IList* addressList = ipHostEntry->GetAddressList();
-
- if (addressList != null)
- {
- int count = addressList->GetCount();
-
- for (int i = 0; i < count; i++)
- {
- IpAddress* pIpAddress = (IpAddress*)(addressList->GetAt(i));
- Tizen::Base::ByteBuffer*_pbb = Tizen::Base::Utility::StringUtil::StringToUtf8N(pIpAddress->ToString());
-
- AppLog("IpAddress no.%d : %s\n", i, (char*)(_pbb->GetPointer()));
- delete _pbb;
- }
- }
-
- Tizen::Base::Collection::IList* aliasList = ipHostEntry->GetAliasList();
-
- if (aliasList != null)
- {
- int count = aliasList->GetCount();
-
- for (int i = 0; i < count; i++)
- {
- String* alias = (String*)(aliasList->GetAt(i));
- Tizen::Base::ByteBuffer*_pbb = Tizen::Base::Utility::StringUtil::StringToUtf8N(*alias);
-
- AppLog("alias no.%d : %s\n", i, (char*)(_pbb->GetPointer()));
- delete _pbb;
- }
- }
- delete ipHostEntry;
- }
-}
- * @endcode
*/
class _OSP_EXPORT_ IpHostEntry
: public Tizen::Base::Object
*
* @since 2.0
*
- * The %NetAccountInfo class provides all the configuration parameters for setting up network connections.
+ * The %NetAccountInfo class provides configuration parameters for setting up network connections.
* %NetAccountInfo contains the base information required to connect to various bearers and it is designed to be
* used in Programmed Data Processor (PDP) context activation. The Wi-Fi accounts are derived from this class
* and contain additional information specific to Wi-Fi (such as SSID).
* The following example demonstrates how to use the %NetConnection class.
*
* @code
-
-// Start the network connection.
-using namespace Tizen::Net;
-
-void
-Test(void)
-{
- // Account ID
- NetAccountId accountId = INVALID_HANDLE;
- result r = E_SUCCESS;
-
- // Account manager
- NetAccountManager netAccountManager;
- r = netAccountManager.Construct();
- accountId = netAccountManager.GetNetAccountId();
-
- // Construct a listener.
- TestListener* pMyListener = new TestListener();
-
- // NetConnection instance allocation.
- NetConnection* pNetConnection = new NetConnection;
-
- // Construct NetConnection.
- r = pNetConnection->Construct(accountId);
-
- // __NetConnectionEvent AddListener.
- r = pNetConnection->AddNetConnectionListener(pMyListener);
-
- // NetConnection connect.
- r = pNetConnection->Start();
-}
+ *
+ * #include <FBase.h>
+ * #include <FNet.h>
+ *
+ * using namespace Tizen::Base;
+ * using namespace Tizen::Net;
+ *
+ * class MyClass
+ * : public Object
+ * , public INetConnectionEventListener
+ * {
+ * public:
+ * MyClass(void) {}
+ * ~MyClass(void) {}
+ *
+ * void OnNetConnectionStarted(NetConnection& netConnection, result r)
+ * {
+ * AppLog("OnStarted result=[%s]\n", GetErrorMessage(r));
+ * }
+ *
+ * void OnNetConnectionStopped(NetConnection& netConnection, result r)
+ * {
+ * AppLog("OnStopped\n");
+ * }
+ *
+ * void OnNetConnectionSuspended(NetConnection& netConnection)
+ * {
+ * AppLog("OnSuspended\n");
+ * }
+ *
+ * void OnNetConnectionResumed(NetConnection& netConnection)
+ * {
+ * AppLog("OnResumed\n");
+ * }
+ *
+ * void StartNetConnection(void);
+ * };
+ *
+ * void
+ * MyClass::StartNetConnection(void)
+ * {
+ * NetAccountManager netAccountManager;
+ * result r = netAccountManager.Construct();
+ * if (IsFailed(r))
+ * {
+ * return;
+ * }
+ *
+ * NetAccountId accountId = netAccountManager.GetNetAccountId(NET_BEARER_PS);
+ *
+ * NetConnection* pNetConnection = new NetConnection();
+ * r = pNetConnection->Construct(accountId);
+ * if (IsFailed(r))
+ * {
+ * delete pNetConnection;
+ * return;
+ * }
+ *
+ * r = pNetConnection->AddNetConnectionListener(*this);
+ * r = pNetConnection->Start();
+ *
+ * // Wait OnNetConnectionStarted() event
+ *
+ * delete pNetConnection;
+ * }
+ *
* @endcode
*/
class _OSP_EXPORT_ NetConnection
/**
* @class NetStatistics
- * @brief This class represents the statistical information on the Packet-Switched (PS) data call.
+ * @brief This class represents the statistical information of the data network.
*
* @since 2.0
*
* @remarks The %NetStatistics class cannot be tested on the emulator.
*
- * The %NetStatistics class provides methods for getting the statistical information on the Packet-Switched (PS) data call.
+ * The %NetStatistics class provides methods for getting the statistical information of the data network.
*
* For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/net/network_statistics.htm">Network Statistics</a>.
*/