3 * Copyright (c) 2000-2012 Samsung Electronics Co., Ltd. All Rights Reserved.
5 * This file is part of msg-service.
7 * Contact: Jaeyun Jeong <jyjeong@samsung.com>
8 * Sangkoo Kim <sangkoo.kim@samsung.com>
9 * Seunghwan Lee <sh.cat.lee@samsung.com>
10 * SoonMin Jung <sm0415.jung@samsung.com>
11 * Jae-Young Lee <jy4710.lee@samsung.com>
12 * KeeBum Kim <keebum.kim@samsung.com>
14 * PROPRIETARY/CONFIDENTIAL
16 * This software is the confidential and proprietary information of
17 * SAMSUNG ELECTRONICS ("Confidential Information"). You shall not
18 * disclose such Confidential Information and shall use it only in
19 * accordance with the terms of the license agreement you entered
20 * into with SAMSUNG ELECTRONICS.
22 * SAMSUNG make no representations or warranties about the suitability
23 * of the software, either express or implied, including but not limited
24 * to the implied warranties of merchantability, fitness for a particular
25 * purpose, or non-infringement. SAMSUNG shall not be liable for any
26 * damages suffered by licensee as a result of using, modifying or
27 * distributing this software or its derivatives.
33 #include "MsgHandle.h"
35 #include "MsgException.h"
36 #include "MapiControl.h"
39 /*==================================================================================================
40 FUNCTION IMPLEMENTATION
41 ==================================================================================================*/
42 EXPORT_API int msg_open_msg_handle(MSG_HANDLE_T *handle)
44 MsgHandle* pHandle = new MsgHandle();
48 MSG_FATAL("Input Paramter is NULL");
53 *handle = (MSG_HANDLE_T)pHandle;
61 pHandle->openHandle();
63 catch (MsgException& e)
65 MSG_FATAL("%s", e.what());
67 if (e.errorCode() == MsgException::SERVER_READY_ERROR)
68 return MSG_ERR_SERVER_NOT_READY;
70 return MSG_ERR_COMMUNICATION_ERROR;
77 EXPORT_API int msg_close_msg_handle(MSG_HANDLE_T *handle)
79 if (handle == NULL || *handle == NULL)
81 MSG_FATAL("Input Paramter is NULL");
85 MsgHandle* pHandle = (MsgHandle*)(*handle);
89 // Disconnect to Socket
90 pHandle->closeHandle(pHandle);
92 catch (MsgException& e)
94 MSG_FATAL("%s", e.what());
95 return MSG_ERR_COMMUNICATION_ERROR;
99 delete (MsgHandle*)(*handle);