-/**********************************************************************
- Description : Close the TCP socket
- Params[In] : None
- Return : ROK - success
- RFAILED - failure
-**********************************************************************/
+/*******************************************************************
+ *
+ * @brief Recieve message over TCP socket
+ *
+ * @details
+ *
+ * Function : receiveData
+ *
+ * Functionality:
+ * - Recieves message over TCP socket
+ *
+ * @params[in] message, size of the message
+ * @return Number of bytes received
+ *
+ ******************************************************************/
+int receiveData(void* data, const int size)
+{
+ int nbytes = read (s_sock, data, size);
+ if (nbytes < 0)
+ {
+ O1_LOG("\nO1 TcpClient : Error reading. %d bytes sent", nbytes);
+ }
+ return nbytes;
+}
+
+/*******************************************************************
+ *
+ * @brief Close the TCP socket
+ *
+ * @details
+ *
+ * Function : closeSocket
+ *
+ * Functionality:
+ * - Closes the TCP socket
+ *
+ * @params[in] message, size of the message
+ * @return ROK - success
+ * RFAILED - failure
+ ******************************************************************/