Fixed bug.
[platform/framework/native/net.git] / inc / FNetSockets.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 //     http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17
18
19 /**
20 * @file         FNetSockets.h
21 * @brief        This is the header file for the %Sockets namespace.
22 *
23 * This header file contains the declarations and descriptions of the %Sockets namespace.
24 */
25
26 #ifndef _FNET_SOCKETS_H_
27 #define _FNET_SOCKETS_H_
28
29 #include <FNetSockSocket.h>
30 #include <FNetSockISocketEventListener.h>
31 #include <FNetSockSecureSocket.h>
32 #include <FNetSockISecureSocketEventListener.h>
33 #include <FNetSockSocketIpMulticastRequestOption.h>
34 #include <FNetSockSocketLingerOption.h>
35 #include <FNetSockSocketUtility.h>
36 #include <FNetSockSocketTypes.h>
37
38 namespace Tizen { namespace Net
39 {
40 /**
41 * @namespace    Tizen::Net::Sockets
42 * @brief                This namespace contains the classes and interfaces for Transmission Control Protocol (TCP) or User Datagram Protocol (UDP) socket
43 *                               programming.
44 * @since        2.0
45 *
46 * @remarks      @b Header @b %file: @b \#include @b <FNet.h> @n
47 *                               @b Library : @b osp-net @n
48 *
49 * The %Tizen::Net::Sockets sub-namespace implements the socket data communication protocols by providing a rich set of methods for connecting,
50 *                               sending, and receiving data over a network.
51 *
52 * For more information on the %Sockets namespace features, see <a href="../org.tizen.native.appprogramming/html/guide/net/sockets.htm">Sockets Guide</a>.
53 *
54 * The following diagram illustrates the relationships between the classes belonging to the %Sockets namespace.
55 * @image html net_socket_using_the_apis_classdiagram.png
56 *
57 * The following example demonstrates how to use a TCP client non-blocking socket.
58 *
59 *                               @code
60 *                               result res = E_SUCCESS;
61 *
62 *                               // Creates the socket.
63 *                               Socket* pClientSocket = new Socket();
64 *                               res = pClientSocket->Construct(NET_SOCKET_AF_IPV4, NET_SOCKET_TYPE_STREAM, NET_SOCKET_PROTOCOL_TCP);
65 *
66 *                               // Adds listener.
67 *                               MySocketClientListener* pSockClientListener = new MySocketClientListener();
68 *                               res = pClientSocket->AddSocketListener(*pSockClientListener);
69 *
70 *                               // Selects asynchronous event (non-blocking mode).
71 *                               res = pClientSocket->AsyncSelectByListener(NET_SOCKET_EVENT_CONNECT| NET_SOCKET_EVENT_CLOSE);
72 *
73 *                               // Creates peer endpoint.
74 *                               Ip4Address peerAddr("XXX.XXX.XXX.XXX"); // Server socket address.
75 *                               unsigned short peerPort = YYY;  // Port
76 *                               NetEndPoint* pPeerEndPoint = new NetEndPoint(peerAddr, peerPort);
77 *
78 *                               // Connects the socket.
79 *                               res = pClientSocket->Connect(*pPeerEndPoint);
80 *                               @endcode
81 */
82 namespace Sockets
83 {
84 } } } // Tizen::Net::Sockets
85 #endif // _FNET_SOCKETS_H_