[Applications.Cion] Fix namespace, ServerBase.DisplayName property, docfx (#3553)
authorjeremy-jang <35089715+jeremy-jang@users.noreply.github.com>
Wed, 13 Oct 2021 08:02:47 +0000 (17:02 +0900)
committerGitHub <noreply@github.com>
Wed, 13 Oct 2021 08:02:47 +0000 (17:02 +0900)
* [Applications.Cion] Fix DisplayName property

Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
* [Applications.Cion] Fix doxygen comments

Add missing description of exceptions.

Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
* Fix ServerBase.DisplayName property

Add missing setting _displayName.

Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
* Add privilege description at ClientBase.Discovery

Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
* Add some remarks FilePayload class

Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
* Add exception description of Client.TryDiscovery

Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
* Add exception description at FilePayload class

Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
* Add privlevel descriptions

Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
* Fix typo

Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
* Fix logging

- Remove debugging logs.
- Change log tag to "Tizen.Applications.Cion".

Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
* Add remarks exceptions at SecurityInfo class

Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
* Fix native error code

Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
* Fix interop delegate name

Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
* Fix cion

- Fix bad codes.
- Update native API changes.

Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
* Fix typo

Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
* Fix bug of ClientBase.SendPayloadAsync

Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
* Adjust changes of native APIs

Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
* Fix typo

ServerBase.OnConnentionRequest() -> ServerBase.OnConnectionRequest()

Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
* Add missing privilege requirements

Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
* Fix namespace

Fix namespace to Tizen.Applications.Cion from Tizen.Applications.

Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
29 files changed:
src/Tizen.Applications.Cion/Interop/Interop.Cion.cs
src/Tizen.Applications.Cion/Interop/Interop.CionClient.cs
src/Tizen.Applications.Cion/Interop/Interop.CionConnectionResult.cs
src/Tizen.Applications.Cion/Interop/Interop.CionGroup.cs
src/Tizen.Applications.Cion/Interop/Interop.CionPayload.cs
src/Tizen.Applications.Cion/Interop/Interop.CionPayloadAsyncResult.cs
src/Tizen.Applications.Cion/Interop/Interop.CionPeerInfo.cs
src/Tizen.Applications.Cion/Interop/Interop.CionServer.cs
src/Tizen.Applications.Cion/Tizen.Applications.Cion/CionErrorFactory.cs [moved from src/Tizen.Applications.Cion/Tizen.Applications/CionErrorFactory.cs with 78% similarity]
src/Tizen.Applications.Cion/Tizen.Applications.Cion/ClientBase.cs [moved from src/Tizen.Applications.Cion/Tizen.Applications/ClientBase.cs with 79% similarity]
src/Tizen.Applications.Cion/Tizen.Applications.Cion/ClientSafeHandle.cs [moved from src/Tizen.Applications.Cion/Tizen.Applications/ClientSafeHandle.cs with 97% similarity]
src/Tizen.Applications.Cion/Tizen.Applications.Cion/ConnectionResult.cs [moved from src/Tizen.Applications.Cion/Tizen.Applications/ConnectionResult.cs with 98% similarity]
src/Tizen.Applications.Cion/Tizen.Applications.Cion/ConnectionStatus.cs [moved from src/Tizen.Applications.Cion/Tizen.Applications/ConnectionStatus.cs with 97% similarity]
src/Tizen.Applications.Cion/Tizen.Applications.Cion/DataPayload.cs [moved from src/Tizen.Applications.Cion/Tizen.Applications/DataPayload.cs with 98% similarity]
src/Tizen.Applications.Cion/Tizen.Applications.Cion/FilePayload.cs [moved from src/Tizen.Applications.Cion/Tizen.Applications/FilePayload.cs with 79% similarity]
src/Tizen.Applications.Cion/Tizen.Applications.Cion/GroupBase.cs [moved from src/Tizen.Applications.Cion/Tizen.Applications/GroupBase.cs with 82% similarity]
src/Tizen.Applications.Cion/Tizen.Applications.Cion/GroupSafeHandle.cs [moved from src/Tizen.Applications.Cion/Tizen.Applications/GroupSafeHandle.cs with 97% similarity]
src/Tizen.Applications.Cion/Tizen.Applications.Cion/Payload.cs [moved from src/Tizen.Applications.Cion/Tizen.Applications/Payload.cs with 93% similarity]
src/Tizen.Applications.Cion/Tizen.Applications.Cion/PayloadAsyncResult.cs [moved from src/Tizen.Applications.Cion/Tizen.Applications/PayloadAsyncResult.cs with 99% similarity]
src/Tizen.Applications.Cion/Tizen.Applications.Cion/PayloadAsyncResultCode.cs [moved from src/Tizen.Applications.Cion/Tizen.Applications/PayloadAsyncResultCode.cs with 97% similarity]
src/Tizen.Applications.Cion/Tizen.Applications.Cion/PayloadSafeHandle.cs [moved from src/Tizen.Applications.Cion/Tizen.Applications/PayloadSafeHandle.cs with 97% similarity]
src/Tizen.Applications.Cion/Tizen.Applications.Cion/PayloadTransferStatus.cs [moved from src/Tizen.Applications.Cion/Tizen.Applications/PayloadTransferStatus.cs with 96% similarity]
src/Tizen.Applications.Cion/Tizen.Applications.Cion/PayloadType.cs [moved from src/Tizen.Applications.Cion/Tizen.Applications/PayloadType.cs with 96% similarity]
src/Tizen.Applications.Cion/Tizen.Applications.Cion/PeerInfo.cs [moved from src/Tizen.Applications.Cion/Tizen.Applications/PeerInfo.cs with 98% similarity]
src/Tizen.Applications.Cion/Tizen.Applications.Cion/PeerInfoSafeHandle.cs [moved from src/Tizen.Applications.Cion/Tizen.Applications/PeerInfoSafeHandle.cs with 97% similarity]
src/Tizen.Applications.Cion/Tizen.Applications.Cion/SecurityInfo.cs [moved from src/Tizen.Applications.Cion/Tizen.Applications/Cion/SecurityInfo.cs with 81% similarity]
src/Tizen.Applications.Cion/Tizen.Applications.Cion/SecuritySafeHandle.cs [moved from src/Tizen.Applications.Cion/Tizen.Applications/Cion/SecuritySafeHandle.cs with 100% similarity]
src/Tizen.Applications.Cion/Tizen.Applications.Cion/ServerBase.cs [moved from src/Tizen.Applications.Cion/Tizen.Applications/ServerBase.cs with 83% similarity]
src/Tizen.Applications.Cion/Tizen.Applications.Cion/ServerSafeHandle.cs [moved from src/Tizen.Applications.Cion/Tizen.Applications/ServerSafeHandle.cs with 97% similarity]

index cbfa407..7676730 100644 (file)
@@ -21,12 +21,15 @@ internal static partial class Interop
         internal enum ErrorCode : int
         {
             None = Tizen.Internals.Errors.ErrorCode.None,
-            InvalidParameter = Tizen.Internals.Errors.ErrorCode.InvalidParameter,
-            OutOfMemory = Tizen.Internals.Errors.ErrorCode.OutOfMemory,
             IoError = Tizen.Internals.Errors.ErrorCode.IoError,
+            OutOfMemory = Tizen.Internals.Errors.ErrorCode.OutOfMemory,
             PermissionDenied = Tizen.Internals.Errors.ErrorCode.PermissionDenied,
+            InvalidParameter = Tizen.Internals.Errors.ErrorCode.InvalidParameter,
             InvalidOperation = Tizen.Internals.Errors.ErrorCode.InvalidOperation,
+            AlreadyInProgress = Tizen.Internals.Errors.ErrorCode.AlreadyInProgress,
             NotSupported = Tizen.Internals.Errors.ErrorCode.NotSupported,
+            TimedOut = Tizen.Internals.Errors.ErrorCode.TimedOut,
+            OperationFailed = -0x030C0000 | 0x01,
         }
     }
 }
index 584be13..9bee7b7 100644 (file)
@@ -16,7 +16,7 @@
 
 using System;
 using System.Runtime.InteropServices;
-using Tizen.Applications;
+using Tizen.Applications.Cion;
 
 using ErrorCode = Interop.Cion.ErrorCode;
 
@@ -25,13 +25,13 @@ internal static partial class Interop
     internal static partial class CionClient
     {
         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
-        internal delegate void CionClientDiscoveredCb(string serviceName, IntPtr peerInfo, IntPtr userData);
+        internal delegate void CionClientServerDiscoveredCb(string serviceName, IntPtr peerInfo, IntPtr userData);
         
         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
         internal delegate void CionClientConnectionResultCb(string serviceName, IntPtr peerInfo, IntPtr result, IntPtr userData);
 
         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
-        internal delegate void CionClientPayloadRecievedCb(string serviceName, IntPtr peerInfo, IntPtr payload, int status, IntPtr userData);
+        internal delegate void CionClientPayloadReceivedCb(string serviceName, IntPtr peerInfo, IntPtr payload, int status, IntPtr userData);
 
         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
         internal delegate void CionClientDisconnectedCb(string serviceName, IntPtr peerInfo, IntPtr userData);
@@ -42,11 +42,11 @@ internal static partial class Interop
         [DllImport(Libraries.Cion, EntryPoint = "cion_client_create")]
         internal static extern ErrorCode CionClientCreate(out ClientSafeHandle client, string serviceName, IntPtr security);
 
-        [DllImport(Libraries.Cion, EntryPoint = "cion_client_destory")]
+        [DllImport(Libraries.Cion, EntryPoint = "cion_client_destroy")]
         internal static extern ErrorCode CionClientDestroy(IntPtr client);
         
         [DllImport(Libraries.Cion, EntryPoint = "cion_client_try_discovery")]
-        internal static extern ErrorCode CionClientTryDiscovery(ClientSafeHandle client, CionClientDiscoveredCb cb, IntPtr userData);
+        internal static extern ErrorCode CionClientTryDiscovery(ClientSafeHandle client, CionClientServerDiscoveredCb cb, IntPtr userData);
         
         [DllImport(Libraries.Cion, EntryPoint = "cion_client_stop_discovery")]
         internal static extern ErrorCode CionClientStopDiscovery(ClientSafeHandle client);
@@ -66,10 +66,19 @@ internal static partial class Interop
         [DllImport(Libraries.Cion, EntryPoint = "cion_client_add_connection_result_cb")]
         internal static extern ErrorCode CionClientAddConnectionResultCb(ClientSafeHandle client, CionClientConnectionResultCb cb, IntPtr userData);
 
-        [DllImport(Libraries.Cion, EntryPoint = "cion_client_add_payload_recieved_cb")]
-        internal static extern ErrorCode CionClientAddPayloadReceivedCb(ClientSafeHandle client, CionClientPayloadRecievedCb cb, IntPtr userData);
+        [DllImport(Libraries.Cion, EntryPoint = "cion_client_remove_connection_result_cb")]
+        internal static extern ErrorCode CionClientRemoveConnectionResultCb(ClientSafeHandle client, CionClientConnectionResultCb cb);
+
+        [DllImport(Libraries.Cion, EntryPoint = "cion_client_add_payload_received_cb")]
+        internal static extern ErrorCode CionClientAddPayloadReceivedCb(ClientSafeHandle client, CionClientPayloadReceivedCb cb, IntPtr userData);
+
+        [DllImport(Libraries.Cion, EntryPoint = "cion_client_remove_payload_received_cb")]
+        internal static extern ErrorCode CionClientRemovePayloadReceivedCb(ClientSafeHandle client, CionClientPayloadReceivedCb cb);
 
         [DllImport(Libraries.Cion, EntryPoint = "cion_client_add_disconnected_cb")]
         internal static extern ErrorCode CionClientAddDisconnectedCb(ClientSafeHandle client, CionClientDisconnectedCb cb, IntPtr userData);
+
+        [DllImport(Libraries.Cion, EntryPoint = "cion_client_remove_disconnected_cb")]
+        internal static extern ErrorCode CionClientRemoveDisconnectedCb(ClientSafeHandle client, CionClientDisconnectedCb cb);
     }
 }
index 359527c..5ea020d 100644 (file)
@@ -16,7 +16,7 @@
 
 using System;
 using System.Runtime.InteropServices;
-using Tizen.Applications;
+using Tizen.Applications.Cion;
 
 using ErrorCode = Interop.Cion.ErrorCode;
 
index 03cbb65..b495c0f 100644 (file)
@@ -16,7 +16,7 @@
 
 using System;
 using System.Runtime.InteropServices;
-using Tizen.Applications;
+using Tizen.Applications.Cion;
 
 using ErrorCode = Interop.Cion.ErrorCode;
 
@@ -51,10 +51,19 @@ internal static partial class Interop
         [DllImport(Libraries.Cion, EntryPoint = "cion_group_add_payload_received_cb")]
         internal static extern ErrorCode CionGroupAddPayloadReceivedCb(GroupSafeHandle group, CionGroupPayloadReceivedCb cb, IntPtr userData);
 
+        [DllImport(Libraries.Cion, EntryPoint = "cion_group_remove_payload_received_cb")]
+        internal static extern ErrorCode CionGroupRemovePayloadReceivedCb(GroupSafeHandle group, CionGroupPayloadReceivedCb cb);
+
         [DllImport(Libraries.Cion, EntryPoint = "cion_group_add_joined_cb")]
         internal static extern ErrorCode CionGroupAddJoinedCb(GroupSafeHandle group, CionGroupJoinedCb cb, IntPtr userData);
 
+        [DllImport(Libraries.Cion, EntryPoint = "cion_group_remove_joined_cb")]
+        internal static extern ErrorCode CionGroupRemoveJoinedCb(GroupSafeHandle group, CionGroupJoinedCb cb);
+
         [DllImport(Libraries.Cion, EntryPoint = "cion_group_add_left_cb")]
         internal static extern ErrorCode CionGroupAddLeftCb(GroupSafeHandle group, CionGroupLeftCb cb, IntPtr userData);
+
+        [DllImport(Libraries.Cion, EntryPoint = "cion_group_remove_left_cb")]
+        internal static extern ErrorCode CionGroupRemoveLeftCb(GroupSafeHandle group, CionGroupLeftCb cb);
     }
 }
index 9d9f87d..faf58cf 100644 (file)
@@ -16,7 +16,7 @@
 
 using System;
 using System.Runtime.InteropServices;
-using Tizen.Applications;
+using Tizen.Applications.Cion;
 
 using ErrorCode = Interop.Cion.ErrorCode;
 
index 8cc12f1..3a8267a 100644 (file)
@@ -16,7 +16,7 @@
 
 using System;
 using System.Runtime.InteropServices;
-using Tizen.Applications;
+using Tizen.Applications.Cion;
 
 using ErrorCode = Interop.Cion.ErrorCode;
 
index daa08e9..37e0b60 100755 (executable)
@@ -16,7 +16,7 @@
 
 using System;
 using System.Runtime.InteropServices;
-using Tizen.Applications;
+using Tizen.Applications.Cion;
 
 using ErrorCode = Interop.Cion.ErrorCode;
 
index b4eedf4..1b48247 100644 (file)
@@ -16,7 +16,7 @@
 
 using System;
 using System.Runtime.InteropServices;
-using Tizen.Applications;
+using Tizen.Applications.Cion;
 
 using ErrorCode = Interop.Cion.ErrorCode;
 
@@ -25,7 +25,7 @@ internal static partial class Interop
     internal static partial class CionServer
     {
         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
-        internal delegate void CionServerPeerInfoIterator(IntPtr peerInfo, IntPtr userData);
+        internal delegate bool CionServerPeerInfoIterator(IntPtr peerInfo, IntPtr userData);
 
         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
         internal delegate void CionServerPayloadAsyncResultCb(IntPtr result, IntPtr userData);
@@ -37,7 +37,7 @@ internal static partial class Interop
         internal delegate void CionServerDataReceivedCb(string serviceName, IntPtr peerInfo, byte[] data, int dataSize, out byte[] returnData, out int returnDataSize, IntPtr userData);
 
         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
-        internal delegate void CionServerPayloadRecievedCb(string serviceName, IntPtr peerInfo, IntPtr payload, int status, IntPtr userData);
+        internal delegate void CionServerPayloadReceivedCb(string serviceName, IntPtr peerInfo, IntPtr payload, int status, IntPtr userData);
 
         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
         internal delegate void CionServerConnectionRequestCb(string serviceName, IntPtr peerInfo, IntPtr userData);
@@ -51,7 +51,7 @@ internal static partial class Interop
         [DllImport(Libraries.Cion, EntryPoint = "cion_server_create")]
         internal static extern ErrorCode CionServerCreate(out ServerSafeHandle server, string serviceName, string displayName, IntPtr security);
 
-        [DllImport(Libraries.Cion, EntryPoint = "cion_server_destory")]
+        [DllImport(Libraries.Cion, EntryPoint = "cion_server_destroy")]
         internal static extern ErrorCode CionServerDestroy(IntPtr server);
         
         [DllImport(Libraries.Cion, EntryPoint = "cion_server_listen")]
@@ -70,8 +70,7 @@ internal static partial class Interop
         internal static extern ErrorCode CionServerDisconnect(ServerSafeHandle server, PeerInfoSafeHandle peerInfo);
 
         [DllImport(Libraries.Cion, EntryPoint = "cion_server_send_payload_async")]
-        internal static extern ErrorCode CionServerSendPayloadAsync(ServerSafeHandle server, PeerInfoSafeHandle peerInfo, PayloadSafeHandle payload, 
-            CionServerPayloadAsyncResultCb cb, IntPtr userData);
+        internal static extern ErrorCode CionServerSendPayloadAsync(ServerSafeHandle server, PeerInfoSafeHandle peerInfo, PayloadSafeHandle payload, CionServerPayloadAsyncResultCb cb, IntPtr userData);
 
         [DllImport(Libraries.Cion, EntryPoint = "cion_server_foreach_connected_peer_info")]
         internal static extern ErrorCode CionServerForeachConnectedPeerInfo(ServerSafeHandle server, CionServerPeerInfoIterator cb, IntPtr userData);
@@ -79,19 +78,31 @@ internal static partial class Interop
         [DllImport(Libraries.Cion, EntryPoint = "cion_server_add_connection_result_cb")]
         internal static extern ErrorCode CionServerAddConnectionResultCb(ServerSafeHandle server, CionServerConnectionResultCb cb, IntPtr userData);
 
-        [DllImport(Libraries.Cion, EntryPoint = "cion_server_add_payload_recieved_cb")]
-        internal static extern ErrorCode CionServerAddPayloadReceivedCb(ServerSafeHandle server, CionServerPayloadRecievedCb cb, IntPtr userData);
+        [DllImport(Libraries.Cion, EntryPoint = "cion_server_remove_connection_result_cb")]
+        internal static extern ErrorCode CionServerRemoveConnectionResultCb(ServerSafeHandle server, CionServerConnectionResultCb cb);
 
-        [DllImport(Libraries.Cion, EntryPoint = "cion_server_add_error_reported_cb")]
-        internal static extern ErrorCode CionServerAddErrorReportedCb(ServerSafeHandle server, CionServerErrorReportedCb cb, IntPtr userData);
+        [DllImport(Libraries.Cion, EntryPoint = "cion_server_add_payload_received_cb")]
+        internal static extern ErrorCode CionServerAddPayloadReceivedCb(ServerSafeHandle server, CionServerPayloadReceivedCb cb, IntPtr userData);
 
-        [DllImport(Libraries.Cion, EntryPoint = "cion_server_set_data_recieved_cb")]
+        [DllImport(Libraries.Cion, EntryPoint = "cion_server_remove_payload_received_cb")]
+        internal static extern ErrorCode CionServerRemovePayloadReceivedCb(ServerSafeHandle server, CionServerPayloadReceivedCb cb, IntPtr userData);
+
+        [DllImport(Libraries.Cion, EntryPoint = "cion_server_set_data_received_cb")]
         internal static extern ErrorCode CionServerSetDataReceivedCb(ServerSafeHandle server, CionServerDataReceivedCb cb, IntPtr userData);
 
+        [DllImport(Libraries.Cion, EntryPoint = "cion_server_unset_data_received_cb")]
+        internal static extern ErrorCode CionServerUnsetDataReceivedCb(ServerSafeHandle server, CionServerDataReceivedCb cb);
+
         [DllImport(Libraries.Cion, EntryPoint = "cion_server_add_disconnected_cb")]
         internal static extern ErrorCode CionServerAddDisconnectedCb(ServerSafeHandle server, CionServerDisconnectedCb cb, IntPtr userData);
 
-        [DllImport(Libraries.Cion, EntryPoint = "cion_server_set_ondemand_launch_enable")]
-        internal static extern ErrorCode CionServerSetOndemandLaunchEnable(ServerSafeHandle server, bool enable);
+        [DllImport(Libraries.Cion, EntryPoint = "cion_server_remove_disconnected_cb")]
+        internal static extern ErrorCode CionServerRemoveDisconnectedCb(ServerSafeHandle server, CionServerDisconnectedCb cb);
+
+        [DllImport(Libraries.Cion, EntryPoint = "cion_server_set_on_demand_launch_enabled")]
+        internal static extern ErrorCode CionServerSetOnDemandLaunchEnabled(ServerSafeHandle server, bool enable);
+
+        [DllImport(Libraries.Cion, EntryPoint = "cion_server_set_display_name")]
+        internal static extern ErrorCode CionServerSetDisplayName(ServerSafeHandle server, string displayName);
     }
 }
@@ -16,7 +16,7 @@
 
 using System;
 
-namespace Tizen.Applications
+namespace Tizen.Applications.Cion
 {
     internal static class CionErrorFactory
     {
@@ -25,21 +25,27 @@ namespace Tizen.Applications
             string errMessage = string.Format("{0} err = {1}", message, err);
             switch (err)
             {
-                case Interop.Cion.ErrorCode.InvalidParameter:
-                    return new ArgumentException(errMessage);
+                case Interop.Cion.ErrorCode.IoError:
+                    return new InvalidOperationException(errMessage);
                 case Interop.Cion.ErrorCode.OutOfMemory:
                     return new InvalidOperationException(errMessage);
-                case Interop.Cion.ErrorCode.IoError:
-                    return new global::System.IO.IOException(errMessage);
                 case Interop.Cion.ErrorCode.PermissionDenied:
                     return new UnauthorizedAccessException(errMessage);
+                case Interop.Cion.ErrorCode.InvalidParameter:
+                    return new ArgumentException(errMessage);
                 case Interop.Cion.ErrorCode.InvalidOperation:
                     return new InvalidOperationException(errMessage);
+                case Interop.Cion.ErrorCode.AlreadyInProgress:
+                    return new InvalidOperationException(errMessage);
                 case Interop.Cion.ErrorCode.NotSupported:
                     return new NotSupportedException(errMessage);
+                case Interop.Cion.ErrorCode.TimedOut:
+                    return new TimeoutException(errMessage);
+                case Interop.Cion.ErrorCode.OperationFailed:
+                    return new InvalidOperationException(errMessage);
                 default:
                     return new InvalidOperationException(errMessage);
             }
         }
     }
-}
+}
\ No newline at end of file
@@ -19,7 +19,7 @@ using System.Collections.Generic;
 using System.Runtime.InteropServices;
 using System.Threading.Tasks;
 
-namespace Tizen.Applications
+namespace Tizen.Applications.Cion
 {
     /// <summary>
     /// An abstract class to represent cion client.
@@ -27,17 +27,18 @@ namespace Tizen.Applications
     /// <since_tizen> 9 </since_tizen>
     public abstract class ClientBase : IDisposable
     {
-        private readonly string LogTag = "Tizen.Cion";
+        private readonly string LogTag = "Tizen.Applications.Cion";
         private readonly ClientSafeHandle _handle;
 
         private PeerInfo _peer;
 
-        private Interop.CionClient.CionClientDiscoveredCb _discoveredCb;
+        private Interop.CionClient.CionClientServerDiscoveredCb _discoveredCb;
         private Interop.CionClient.CionClientConnectionResultCb _connectionResultCb;
-        private Interop.CionClient.CionClientPayloadRecievedCb _payloadRecievedCb;
+        private Interop.CionClient.CionClientPayloadReceivedCb _payloadRecievedCb;
         private Interop.CionClient.CionClientDisconnectedCb _disconnectedCb;
         private Interop.CionClient.CionClientPayloadAsyncResultCb _payloadAsyncResultCb;
         private Dictionary<string, TaskCompletionSource<PayloadAsyncResult>> _tcsDictionary = new Dictionary<string, TaskCompletionSource<PayloadAsyncResult>>();
+        private Dictionary<string, Interop.CionClient.CionClientPayloadAsyncResultCb> _payloadAsyncCbDictionary = new Dictionary<string, Interop.CionClient.CionClientPayloadAsyncResultCb>();
 
         /// <summary>
         /// Gets the service name of current cion client.
@@ -61,7 +62,9 @@ namespace Tizen.Applications
         /// The constructor of ClientBase class.
         /// </summary>
         /// <param name="serviceName">The name of service.</param>
-        /// <exception cref="OutOfMemoryException">Thrown when there is not enough memory to continue the execution of the method.</exception> 
+        /// <remarks>The maximum length of service name is 512.</remarks>
+        /// <exception cref="ArgumentException">Thrown when the given service name is too long.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when there is not enough memory to continue the execution of the method.</exception> 
         /// <since_tizen> 9 </since_tizen>
         public ClientBase(string serviceName) : this(serviceName, null) { }
 
@@ -70,13 +73,15 @@ namespace Tizen.Applications
         /// </summary>
         /// <param name="serviceName">The name of service.</param>
         /// <param name="security">The security configuration.</param>
-        /// <exception cref="OutOfMemoryException">Thrown when there is not enough memory to continue the execution of the method.</exception> 
+        /// <remarks>The maximum length of service name is 512.</remarks>
+        /// <exception cref="ArgumentException">Thrown when the given service name is too long.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when there is not enough memory to continue the execution of the method.</exception> 
         /// <since_tizen> 9 </since_tizen>
         public ClientBase(string serviceName, Cion.SecurityInfo security)
         {
             ServiceName = serviceName;
 
-            Cion.SecuritySafeHandle handle = security?._handle;
+            SecuritySafeHandle handle = security?._handle;
             Interop.Cion.ErrorCode ret = Interop.CionClient.CionClientCreate(out _handle, serviceName, handle?.DangerousGetHandle() ?? IntPtr.Zero);
             if (ret != Interop.Cion.ErrorCode.None)
             {
@@ -109,7 +114,7 @@ namespace Tizen.Applications
                 throw CionErrorFactory.GetException(ret, "Failed to add connection status changed callback.");
             }
 
-            _payloadRecievedCb = new Interop.CionClient.CionClientPayloadRecievedCb(
+            _payloadRecievedCb = new Interop.CionClient.CionClientPayloadReceivedCb(
                 (string service, IntPtr peerInfo, IntPtr payload, int status, IntPtr userData) =>
                 {
                     Payload receivedPayload;
@@ -157,19 +162,19 @@ namespace Tizen.Applications
         /// <summary>
         /// Starts discovering cion servers.
         /// </summary>
+        /// <privilege>http://tizen.org/privilege/d2d.datasharing</privilege>
+        /// <privilege>http://tizen.org/privilege/internet</privilege>
+        /// <privlevel>public</privlevel>
         /// <exception cref="InvalidOperationException">Thrown when the discovery operation is already in progress.</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when an application does not have the privilege to access this method.</exception>
         /// <since_tizen> 9 </since_tizen>
         public void TryDiscovery()
         {
-            Log.Error(LogTag, string.Format("Try discovery start"));
-
             if (_discoveredCb == null)
             {
-                Interop.CionClient.CionClientDiscoveredCb cb = new Interop.CionClient.CionClientDiscoveredCb(
+                Interop.CionClient.CionClientServerDiscoveredCb cb = new Interop.CionClient.CionClientServerDiscoveredCb(
                     (string serviceName, IntPtr peerInfo, IntPtr userData) =>
                     {
-                        Log.Error(LogTag, string.Format("callback called !!"));
-
                         Interop.Cion.ErrorCode clone_ret = Interop.CionPeerInfo.CionPeerInfoClone(peerInfo, out PeerInfoSafeHandle clone);
                         if (clone_ret != Interop.Cion.ErrorCode.None)
                         {
@@ -207,6 +212,10 @@ namespace Tizen.Applications
         /// </summary>
         /// <param name="peer">The peer to connect.</param>
         /// <privilege>http://tizen.org/privilege/d2d.datasharing</privilege>
+        /// <privilege>http://tizen.org/privilege/internet</privilege>
+        /// <privlevel>public</privlevel>
+        /// <exception cref="InvalidOperationException">Thrown when the client cannot connect to server.</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when an application does not have the privilege to access this method.</exception>
         /// <since_tizen> 9 </since_tizen>
         public void Connect(PeerInfo peer)
         {
@@ -226,7 +235,7 @@ namespace Tizen.Applications
             Interop.Cion.ErrorCode ret = Interop.CionClient.CionClientDisconnect(_handle);
             if (ret != Interop.Cion.ErrorCode.None)
             {
-                throw CionErrorFactory.GetException(ret, "Failed to disconnect.");
+                Log.Error(LogTag, string.Format("Failed to disconnect: {0}", ret));
             }
             _peer = null;
         }
@@ -237,7 +246,8 @@ namespace Tizen.Applications
         /// <param name="data">The data to send.</param>
         /// <param name="timeout">The timeout of sending operation.</param>
         /// <exception cref="ArgumentException">Thrown when the given data is invalid.</exception>
-        /// <exception cref="InvalidOperationException">Thrown when there is no connected cion server.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when there is no connected cion server or failed to receive reply.</exception>
+        /// <exception cref="TimeoutException">Thrown when a timeout occurred.</exception>
         /// <since_tizen> 9 </since_tizen>
         public byte[] SendData(byte[] data, int timeout)
         {
@@ -258,7 +268,7 @@ namespace Tizen.Applications
         /// </summary>
         /// <param name="payload">The payload to send.</param>
         /// <exception cref="ArgumentException">Thrown when the payload is not valid.</exception>
-        /// <exception cref="InvalidOperationException">Thrown when there is no connected cion server.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when there is no connected cion server or failed to send payload.</exception>
         /// <since_tizen> 9 </since_tizen>
         public Task<PayloadAsyncResult> SendPayloadAsync(Payload payload)
         {
@@ -267,31 +277,33 @@ namespace Tizen.Applications
                 throw new ArgumentException("Payload is invalid.");
             }
 
+            if (_tcsDictionary.ContainsKey(payload.Id))
+            {
+                throw new InvalidOperationException("Payload is already sent.");
+            }
+
             TaskCompletionSource<PayloadAsyncResult> tcs = new TaskCompletionSource<PayloadAsyncResult>();
             _tcsDictionary[payload.Id] = tcs;
 
-            if (_payloadAsyncResultCb == null)
-            {
-                Interop.CionClient.CionClientPayloadAsyncResultCb cb = new Interop.CionClient.CionClientPayloadAsyncResultCb(
-                    (IntPtr result, IntPtr userData) =>
+            Interop.CionClient.CionClientPayloadAsyncResultCb cb = new Interop.CionClient.CionClientPayloadAsyncResultCb(
+                (IntPtr result, IntPtr userData) =>
+                {
+                    TaskCompletionSource<PayloadAsyncResult> tcsToReturn = _tcsDictionary[payload.Id];
+                    PayloadAsyncResult resultPayload = null;
+                    try
                     {
-                        TaskCompletionSource<PayloadAsyncResult> tcsToReturn = _tcsDictionary[payload.Id];
-                        PayloadAsyncResult resultPayload = null;
-                        try
-                        {
-                            resultPayload = PayloadAsyncResult.CreateFromHandle(result);
-                        }
-                        catch (Exception e)
-                        {
-                            Log.Error(LogTag, string.Format("Failed to create PayloadAsyncResult from result handle: {0}.", e.Message));
-                            tcsToReturn.SetException(e);
-                            return;
-                        }
-                        tcsToReturn.SetResult(resultPayload);
-                        _tcsDictionary.Remove(resultPayload.PayloadId);
-                    });
-                _payloadAsyncResultCb = cb;
-            }
+                        resultPayload = PayloadAsyncResult.CreateFromHandle(result);
+                    }
+                    catch (Exception e)
+                    {
+                        Log.Error(LogTag, string.Format("Failed to create PayloadAsyncResult from result handle: {0}.", e.Message));
+                        tcsToReturn.SetException(e);
+                        return;
+                    }
+                    tcsToReturn.SetResult(resultPayload);
+                    _payloadAsyncCbDictionary.Remove(resultPayload.PayloadId);
+                    _tcsDictionary.Remove(resultPayload.PayloadId);
+                });
 
             Interop.Cion.ErrorCode ret = Interop.CionClient.CionClientSendPayloadAsync(_handle, payload?._handle, _payloadAsyncResultCb, IntPtr.Zero);
             if (ret != Interop.Cion.ErrorCode.None)
@@ -299,6 +311,8 @@ namespace Tizen.Applications
                 throw CionErrorFactory.GetException(ret, "Failed to send payload.");
             }
 
+            _payloadAsyncCbDictionary[payload?.Id] = cb;
+
             return tcs.Task;
         }
 
@@ -18,7 +18,7 @@ using System;
 using System.ComponentModel;
 using System.Runtime.InteropServices;
 
-namespace Tizen.Applications
+namespace Tizen.Applications.Cion
 {
     internal sealed class ClientSafeHandle : SafeHandle
     {
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-namespace Tizen.Applications
+namespace Tizen.Applications.Cion
 {
     /// <summary>
     /// Enumeration for connection status.
@@ -19,7 +19,7 @@ using System.Collections.Generic;
 using System.Linq;
 using System.Runtime.InteropServices;
 
-namespace Tizen.Applications
+namespace Tizen.Applications.Cion
 {
     /// <summary>
     /// A class to represent data type payload.
@@ -16,7 +16,7 @@
 
 using System;
 
-namespace Tizen.Applications
+namespace Tizen.Applications.Cion
 {
     /// <summary>
     /// A class to represent file type payload.
@@ -24,7 +24,7 @@ namespace Tizen.Applications
     /// <since_tizen> 9 </since_tizen>
     public class FilePayload : Payload
     {
-        private readonly string LogTag = "Tizen.Cion";
+        private readonly string LogTag = "Tizen.Applications.Cion";
 
         internal FilePayload(PayloadSafeHandle handle)
         {
@@ -35,7 +35,12 @@ namespace Tizen.Applications
         /// The constructor of FilePayload class.
         /// </summary>
         /// <param name="path">The path of file for the FilePayload.</param>
+        /// <remarks>
+        /// http://tizen.org/privilege/mediastorage is needed if the file path is relevant to media storage.
+        /// http://tizen.org/privilege/externalstorage is needed if the file path is relevant to external storage.
+        /// </remarks>
         /// <exception cref="ArgumentException">Thrown when the input file path is invalid.</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when an application does not have the privilege to access this method.</exception>
         /// <since_tizen> 9 </since_tizen>
         public FilePayload(string path)
         {
@@ -113,6 +118,12 @@ namespace Tizen.Applications
         /// Saves file of payload to speicific path.
         /// </summary>
         /// <param name="path">The path of file to save.</param>
+        /// <remarks>
+        /// http://tizen.org/privilege/mediastorage is needed if the file path is relevant to media storage.
+        /// http://tizen.org/privilege/externalstorage is needed if the file path is relevant to external storage.
+        /// </remarks>
+        /// <exception cref="ArgumentException">Thrown when the input file path is invalid.</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when an application does not have the privilege to access this method.</exception>
         /// <since_tizen> 9 </since_tizen>
         public void SaveAsFile(string path)
         {
@@ -16,7 +16,7 @@
 
 using System;
 
-namespace Tizen.Applications
+namespace Tizen.Applications.Cion
 {
     /// <summary>
     /// An abstract class to represent cion group.
@@ -24,6 +24,7 @@ namespace Tizen.Applications
     /// <since_tizen> 9 </since_tizen>
     public abstract class GroupBase : IDisposable
     {
+        private readonly string LogTag = "Tizen.Applications.Cion";
         private readonly GroupSafeHandle _handle;
 
         private Interop.CionGroup.CionGroupPayloadReceivedCb _payloadReceivedCb;
@@ -40,6 +41,9 @@ namespace Tizen.Applications
         /// The constructor of GroupBase class.
         /// </summary>
         /// <param name="topicName">The topic of group.</param>
+        /// <remarks>The maximum length of topic name is 512.</remarks>
+        /// <exception cref="ArgumentException">Thrown when the given topic name is too long.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when there is not enough memory to continue the execution of the method.</exception>
         /// <since_tizen> 9 </since_tizen>
         public GroupBase(string topicName) : this(topicName, null) { }
 
@@ -48,7 +52,9 @@ namespace Tizen.Applications
         /// </summary>
         /// <param name="topicName">The topic of group.</param>
         /// <param name="security">The security configuration.</param>
-        /// <exception cref="OutOfMemoryException">Thrown when there is not enough memory to continue the execution of the method.</exception>
+        /// <remarks>The maximum length of topic name is 512.</remarks>
+        /// <exception cref="ArgumentException">Thrown when the given topic name is too long.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when there is not enough memory to continue the execution of the method.</exception>
         /// <since_tizen> 9 </since_tizen>
         public GroupBase(string topicName, Cion.SecurityInfo security)
         {
@@ -75,9 +81,16 @@ namespace Tizen.Applications
                             receivedPayload = new FilePayload(new PayloadSafeHandle(payload, false));
                             break;
                         default:
-                            throw new ArgumentException("Invalid payload type received.");
+                            Log.Error(LogTag, "Invalid payload type received.");
+                            return;
                     }
-                    OnPayloadReceived(receivedPayload, new PeerInfo(new PeerInfoSafeHandle(peerInfo, false)));
+                    Interop.Cion.ErrorCode clone_ret = Interop.CionPeerInfo.CionPeerInfoClone(peerInfo, out PeerInfoSafeHandle clone);
+                    if (clone_ret != Interop.Cion.ErrorCode.None)
+                    {
+                        Log.Error(LogTag, "Failed to clone peer info.");
+                        return;
+                    }
+                    OnPayloadReceived(receivedPayload, new PeerInfo(clone));
                 });
             ret = Interop.CionGroup.CionGroupAddPayloadReceivedCb(_handle, _payloadReceivedCb, IntPtr.Zero);
             if (ret != Interop.Cion.ErrorCode.None)
@@ -125,6 +138,10 @@ namespace Tizen.Applications
         /// Subscribes the topic.
         /// </summary>
         /// <privilege>http://tizen.org/privilege/d2d.datasharing</privilege>
+        /// <privilege>http://tizen.org/privilege/internet</privilege>
+        /// <privlevel>public</privlevel>
+        /// <exception cref="InvalidOperationException">Thrown when failed to subscribe.</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when an application does not have the privilege to access this method.</exception>
         /// <since_tizen> 9 </since_tizen>
         public void Subscribe()
         {
@@ -144,7 +161,7 @@ namespace Tizen.Applications
             Interop.Cion.ErrorCode ret = Interop.CionGroup.CionGroupUnsubscribe(_handle);
             if (ret != Interop.Cion.ErrorCode.None)
             {
-                throw CionErrorFactory.GetException(ret, "Failed to unsubscribe.");
+                Log.Error(LogTag, string.Format("Failed to unsubscribe: {0}", ret));
             }
         }
 
@@ -153,6 +170,7 @@ namespace Tizen.Applications
         /// </summary>
         /// <param name="payload">The payload to publish.</param>
         /// <exception cref="ArgumentException">Thrown when the payload is invalid.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when failed to publish.</exception>
         /// <since_tizen> 9 </since_tizen>
         public void Publish(Payload payload)
         {
@@ -18,7 +18,7 @@ using System;
 using System.ComponentModel;
 using System.Runtime.InteropServices;
 
-namespace Tizen.Applications
+namespace Tizen.Applications.Cion
 {
     internal sealed class GroupSafeHandle : SafeHandle
     {
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-namespace Tizen.Applications
+namespace Tizen.Applications.Cion
 {
     /// <summary>
     /// An abstract class to represent payload.
@@ -22,7 +22,7 @@ namespace Tizen.Applications
     /// <since_tizen> 9 </since_tizen>
     public abstract class Payload
     {
-        private readonly string LogTag = "Tizen.Cion";
+        private readonly string LogTag = "Tizen.Applications.Cion";
         internal PayloadSafeHandle _handle;
 
         /// <summary>
@@ -18,7 +18,7 @@ using System;
 using System.ComponentModel;
 using System.Runtime.InteropServices;
 
-namespace Tizen.Applications
+namespace Tizen.Applications.Cion
 {
     internal sealed class PayloadSafeHandle : SafeHandle
     {
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-namespace Tizen.Applications
+namespace Tizen.Applications.Cion
 {
     /// <summary>
     /// Enumeration for payload type.
@@ -16,7 +16,7 @@
 
 using System;
 
-namespace Tizen.Applications
+namespace Tizen.Applications.Cion
 {
     /// <summary>
     /// A class to represent peer info.
@@ -24,7 +24,7 @@ namespace Tizen.Applications
     /// <since_tizen> 9 </since_tizen>
     public class PeerInfo : IDisposable
     {
-        private readonly string LogTag = "Tizen.Cion";
+        private readonly string LogTag = "Tizen.Applications.Cion";
         internal PeerInfoSafeHandle _handle;
 
         internal PeerInfo(PeerInfoSafeHandle handle)
@@ -18,7 +18,7 @@ using System;
 using System.ComponentModel;
 using System.Runtime.InteropServices;
 
-namespace Tizen.Applications
+namespace Tizen.Applications.Cion
 {
     internal sealed class PeerInfoSafeHandle : SafeHandle
     {
@@ -44,7 +44,12 @@ namespace Tizen.Applications.Cion
         /// <summary>
         /// Gets the CA cert path.
         /// </summary>
+        /// <remarks>
+        /// http://tizen.org/privilege/mediastorage is needed if the file path is relevant to media storage.
+        /// http://tizen.org/privilege/externalstorage is needed if the file path is relevant to external storage.
+        /// </remarks>
         /// <exception cref="ArgumentException">Thrown when the CA path is invalid.</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when an application does not have the privilege to access this method.</exception>
         /// <since_tizen> 9 </since_tizen>
         public string CaPath
         {
@@ -72,7 +77,12 @@ namespace Tizen.Applications.Cion
         /// <summary>
         /// Gets the cert path.
         /// </summary>
+        /// <remarks>
+        /// http://tizen.org/privilege/mediastorage is needed if the file path is relevant to media storage.
+        /// http://tizen.org/privilege/externalstorage is needed if the file path is relevant to external storage.
+        /// </remarks>
         /// <exception cref="ArgumentException">Thrown when the cert path is invalid.</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when an application does not have the privilege to access this method.</exception>
         /// <since_tizen> 9 </since_tizen>
         public string CertPath
         {
@@ -100,7 +110,12 @@ namespace Tizen.Applications.Cion
         /// <summary>
         /// Gets the private key path.
         /// </summary>
+        /// <remarks>
+        /// http://tizen.org/privilege/mediastorage is needed if the file path is relevant to media storage.
+        /// http://tizen.org/privilege/externalstorage is needed if the file path is relevant to external storage.
+        /// </remarks>
         /// <exception cref="ArgumentException">Thrown when the private key path is invalid.</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when an application does not have the privilege to access this method.</exception>
         /// <since_tizen> 9 </since_tizen>
         public string PrivateKeyPath
         {
@@ -18,7 +18,7 @@ using System;
 using System.Collections.Generic;
 using System.Threading.Tasks;
 
-namespace Tizen.Applications
+namespace Tizen.Applications.Cion
 {
     /// <summary>
     /// An abstract class to represent cion server.
@@ -26,13 +26,14 @@ namespace Tizen.Applications
     /// <since_tizen> 9 </since_tizen>
     public abstract class ServerBase : IDisposable
     {
-        private const string LogTag = "Tizen.Cion";
+        private readonly string LogTag = "Tizen.Applications.Cion";
 
+        private string _displayName;
         private readonly ServerSafeHandle _handle;
         private Interop.CionServer.CionServerConnectionRequestCb _connectionRequestCb;
         private Interop.CionServer.CionServerConnectionResultCb _connectionResultCb;
         private Interop.CionServer.CionServerDataReceivedCb _dataReceivedCb;
-        private Interop.CionServer.CionServerPayloadRecievedCb _payloadRecievedCb;
+        private Interop.CionServer.CionServerPayloadReceivedCb _payloadRecievedCb;
         private Interop.CionServer.CionServerDisconnectedCb _disconnectedCb;
         private Interop.CionServer.CionServerPayloadAsyncResultCb _payloadAsyncResultCb;
         private Dictionary<Tuple<string, string>, TaskCompletionSource<PayloadAsyncResult>> _tcsDictionary = new Dictionary<Tuple<string, string>, TaskCompletionSource<PayloadAsyncResult>>();
@@ -44,17 +45,38 @@ namespace Tizen.Applications
         public string ServiceName { get; }
 
         /// <summary>
-        /// Gets the display name of current cion server.
+        /// Gets or sets the display name of current cion server.
         /// </summary>
         /// <since_tizen> 9 </since_tizen>
-        public string DisplayName { get; }
+        public string DisplayName
+        {
+            get
+            {
+                return _displayName;
+            }
+
+            set
+            {
+                Interop.Cion.ErrorCode ret = Interop.CionServer.CionServerSetDisplayName(_handle, value);
+                if (ret != Interop.Cion.ErrorCode.None)
+                {
+                    Log.Error(LogTag, string.Format("Failed to set display name: {0}", ret));
+                }
+                else
+                {
+                    _displayName = value;
+                }
+            }
+        }
 
         /// <summary>
         /// The constructor of ServerBase class.
         /// </summary>
         /// <param name="serviceName">The name of service.</param>
         /// <param name="displayName">The display name of service.</param>
-        /// <exception cref="OutOfMemoryException">Thrown when there is not enough memory to continue the execution of the method.</exception> 
+        /// <remarks>The maximum length of service name is 512.</remarks>
+        /// <exception cref="ArgumentException">Thrown when the given service name is too long.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when there is not enough memory to continue the execution of the method.</exception> 
         /// <since_tizen> 9 </since_tizen>
         public ServerBase(string serviceName, string displayName) : this(serviceName, displayName, null) { }
 
@@ -64,12 +86,14 @@ namespace Tizen.Applications
         /// <param name="serviceName">The name of service.</param>
         /// <param name="displayName">The display name of service.</param>
         /// <param name="security">The security configuration.</param>
-        /// <exception cref="OutOfMemoryException">Thrown when there is not enough memory to continue the execution of the method.</exception>
+        /// <remarks>The maximum length of service name is 512.</remarks>
+        /// <exception cref="ArgumentException">Thrown when the given service name is too long.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when there is not enough memory to continue the execution of the method.</exception>
         /// <since_tizen> 9 </since_tizen>
         public ServerBase(string serviceName, string displayName, Cion.SecurityInfo security)
         {
             ServiceName = serviceName;
-            DisplayName = displayName;
+            _displayName = displayName;
 
             Cion.SecuritySafeHandle handle = security?._handle;
             Interop.Cion.ErrorCode ret = Interop.CionServer.CionServerCreate(out _handle, serviceName, displayName, handle?.DangerousGetHandle() ?? IntPtr.Zero);
@@ -99,7 +123,14 @@ namespace Tizen.Applications
             _dataReceivedCb = new Interop.CionServer.CionServerDataReceivedCb(
                 (string service, IntPtr peerInfo, byte[] data, int dataSize, out byte[] returnData, out int returnDataSize, IntPtr userData) =>
                 {
-                    returnData = OnDataReceived(data, new PeerInfo(new PeerInfoSafeHandle(peerInfo, false)));
+                    Interop.Cion.ErrorCode clone_ret = Interop.CionPeerInfo.CionPeerInfoClone(peerInfo, out PeerInfoSafeHandle clone);
+                    if (clone_ret != Interop.Cion.ErrorCode.None)
+                    {
+                        Log.Error(LogTag, "Failed to clone peer info.");
+                        returnData = null;
+                        returnDataSize = -1;
+                    }
+                    returnData = OnDataReceived(data, new PeerInfo(clone));
                     returnDataSize = returnData.Length;
                 });
             ret = Interop.CionServer.CionServerSetDataReceivedCb(_handle, _dataReceivedCb, IntPtr.Zero);
@@ -109,7 +140,7 @@ namespace Tizen.Applications
                 throw CionErrorFactory.GetException(ret, "Failed to set data received callback.");
             }     
 
-            _payloadRecievedCb = new Interop.CionServer.CionServerPayloadRecievedCb(
+            _payloadRecievedCb = new Interop.CionServer.CionServerPayloadReceivedCb(
                 (string service, IntPtr peerInfo, IntPtr payload, int status, IntPtr userData) =>
                 {
                     Payload receivedPayload;
@@ -126,7 +157,13 @@ namespace Tizen.Applications
                             Log.Error(LogTag, "Invalid payload type received.");
                             return;
                     }
-                    OnPayloadReceived(receivedPayload, new PeerInfo(new PeerInfoSafeHandle(peerInfo, false)), (PayloadTransferStatus)status);
+                    Interop.Cion.ErrorCode clone_ret = Interop.CionPeerInfo.CionPeerInfoClone(peerInfo, out PeerInfoSafeHandle clone);
+                    if (clone_ret != Interop.Cion.ErrorCode.None)
+                    {
+                        Log.Error(LogTag, "Failed to clone peer info.");
+                        return;
+                    }
+                    OnPayloadReceived(receivedPayload, new PeerInfo(clone), (PayloadTransferStatus)status);
                 });
             ret = Interop.CionServer.CionServerAddPayloadReceivedCb(_handle, _payloadRecievedCb, IntPtr.Zero);
             if (ret != Interop.Cion.ErrorCode.None)
@@ -157,8 +194,11 @@ namespace Tizen.Applications
         /// <summary>
         /// Starts server and listens for requests from cion clients.
         /// </summary>
-        /// <exception cref="InvalidOperationException">Thrown when the listen operation is already in progress.</exception>
         /// <privilege>http://tizen.org/privilege/d2d.datasharing</privilege>
+        /// <privilege>http://tizen.org/privilege/internet</privilege>
+        /// <privlevel>public</privlevel>
+        /// <exception cref="InvalidOperationException">Thrown when the listen operation is already in progress.</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when an application does not have the privilege to access this method.</exception>
         /// <since_tizen> 9 </since_tizen>
         public void Listen()
         {
@@ -173,7 +213,7 @@ namespace Tizen.Applications
                             Log.Error(LogTag, "Failed to clone peer info");
                             return;
                         }
-                        OnConnentionRequest(new PeerInfo(clone));
+                        OnConnectionRequest(new PeerInfo(clone));
                     });
                 _connectionRequestCb = cb;
             }
@@ -220,7 +260,7 @@ namespace Tizen.Applications
         /// <param name="payload">The payload to send.</param>
         /// <param name="peerInfo">The peer to send payload.</param>
         /// <exception cref="ArgumentException">Thrown when the payload is not valid.</exception>
-        /// <exception cref="InvalidOperationException">Thrown when there is no such connected cion client.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when there is no such connected cion client or failed to send payload.</exception>
         /// <since_tizen> 9 </since_tizen>
         public Task<PayloadAsyncResult> SendPayloadAsync(Payload payload, PeerInfo peerInfo)
         {
@@ -267,6 +307,8 @@ namespace Tizen.Applications
         /// Sends the payload to all of connected peer asynchronously.
         /// </summary>
         /// <param name="payload">The payload to send.</param>
+        /// <exception cref="ArgumentException">Thrown when the payload is not valid.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when failed to send payload.</exception>
         /// <since_tizen> 9 </since_tizen>
         public void SendPayloadAsync(Payload payload)
         {
@@ -301,7 +343,7 @@ namespace Tizen.Applications
         /// <summary>
         /// Gets connected peers.
         /// </summary>
-        /// <exception cref="OutOfMemoryException">Thrown when there is not enough memory to continue the execution of the method.</exception> 
+        /// <exception cref="InvalidOperationException">Thrown when there is not enough memory to continue the execution of the method.</exception> 
         /// <since_tizen> 9 </since_tizen>
         public IEnumerable<PeerInfo> GetConnectedPeerList()
         {
@@ -311,9 +353,11 @@ namespace Tizen.Applications
                 Interop.Cion.ErrorCode clone_ret = Interop.CionPeerInfo.CionPeerInfoClone(peer, out PeerInfoSafeHandle clone);
                 if (clone_ret != Interop.Cion.ErrorCode.None)
                 {
-                    throw CionErrorFactory.GetException(clone_ret, "Failed to clone peer info.");
+                    Log.Error(LogTag, "Failed to clone peer info.");
+                    return false;
                 }
                 peerInfoList.Add(new PeerInfo(clone));
+                return true;
             }, IntPtr.Zero);
             return peerInfoList;
         }
@@ -322,12 +366,13 @@ namespace Tizen.Applications
         /// Sets ondemand launch enabled flag.
         /// </summary>
         /// <param name="enable">Whether ondemand launch is enabled or not.</param>
-        /// <exception cref="UnauthorizedAccessException">Thrown when an application does not have the privilege to access this method.</exception>
         /// <privilege>http://tizen.org/privilege/d2d.remotelaunch</privilege>
+        /// <privlevel>public</privlevel>
+        /// <exception cref="UnauthorizedAccessException">Thrown when an application does not have the privilege to access this method.</exception>
         /// <since_tizen> 9 </since_tizen>
         public void SetOndemandLaunchEnabled(bool enable)
         {
-            Interop.Cion.ErrorCode ret = Interop.CionServer.CionServerSetOndemandLaunchEnable(_handle, enable);
+            Interop.Cion.ErrorCode ret = Interop.CionServer.CionServerSetOnDemandLaunchEnabled(_handle, enable);
             if (ret != Interop.Cion.ErrorCode.None)
             {
                 throw CionErrorFactory.GetException(ret, "Failed to set ondemand launch enable");
@@ -364,7 +409,7 @@ namespace Tizen.Applications
         /// </summary>
         /// <param name="peerInfo">The peer info of the cion client.</param>
         /// <since_tizen> 9 </since_tizen>
-        protected abstract void OnConnentionRequest(PeerInfo peerInfo);
+        protected abstract void OnConnectionRequest(PeerInfo peerInfo);
 
         /// <summary>
         /// The callback invoked when disconnected with cion client.
@@ -18,7 +18,7 @@ using System;
 using System.ComponentModel;
 using System.Runtime.InteropServices;
 
-namespace Tizen.Applications
+namespace Tizen.Applications.Cion
 {
     internal sealed class ServerSafeHandle : SafeHandle
     {