2 * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
25 enum com_core_event_type {
27 CONNECTOR_DISCONNECTED
36 * \param[in] service_cb
42 extern int com_core_server_create(const char *addr, int is_sync, const char *label, int (*service_cb)(int fd, void *data), void *data);
50 * \param[in] service_cb
56 extern int com_core_client_create(const char *addr, int is_sync, int (*service_cb)(int fd, void *data), void *data);
60 extern int com_core_client_create_by_fd(int client_fd, int is_sync, int (*service_cb)(int fd, void *data), void *data);
71 extern int com_core_server_destroy(int handle);
82 extern int com_core_client_destroy(int handle);
85 * \brief Used to handling the changing event of connection status.
86 * These two functions can be work with com_core_thread series functions.
90 * \param[in] service_cb
96 extern int com_core_add_event_callback(enum com_core_event_type type, int (*service_cb)(int handle, void *data), void *data);
103 * \param[in] service_cb
109 extern void *com_core_del_event_callback(enum com_core_event_type type, int (*service_cb)(int handle, void *data), void *data);
112 * \brief If the connection is lost, this recv function will call the disconnected callback.
118 * \param[in] sender_pid
124 extern int com_core_recv(int handle, char *buffer, int size, int *sender_pid, double timeout);
138 extern int com_core_send(int handle, const char *buffer, int size, double timeout);
153 extern int com_core_send_with_fd(int handle, const char *buffer, int size, double timeout, int fd);
162 * @param[out] sender_pid
166 extern int com_core_recv_with_fd(int handle, char *buffer, int size, int *sender_pid, double timeout, int *fd);