+ void* ptrType = u_arraylist_get(list, i);
+
+ if (NULL == ptrType)
+ {
+ continue;
+ }
+
+ CATransportAdapter_t connType = *(CATransportAdapter_t *)ptrType;
+ if (0 == (connType & requestedAdapter))
+ {
+ continue;
+ }
+
+ int index = CAGetAdapterIndex(connType);
+
+ if (-1 == index)
+ {
+ OIC_LOG(ERROR, TAG, "unknown transport type!");
+ return CA_STATUS_INVALID_PARAM;
+ }
+
+ int32_t sentDataLen = 0;
+
+ if (NULL != g_adapterHandler[index].sendData)
+ {
+ OIC_LOG(DEBUG, TAG, "unicast message to adapter");
+ sentDataLen = g_adapterHandler[index].sendData(endpoint, data, length, dataType);
+ }
+
+ if (sentDataLen != (int32_t)length)
+ {
+ OIC_LOG(ERROR, TAG, "error in sending data. Error will be reported in adapter");
+#ifdef SINGLE_THREAD
+ //in case of single thread, no error handler. Report error immediately
+ return CA_SEND_FAILED;
+#endif
+ }