4 * Copyright (c) 2017 Samsung Electronics Co., Ltd.
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
20 #ifndef __IPC_SERVER_H__
21 #define __IPC_SERVER_H__
25 #include "stream_socket.h"
27 #include "channel_handler.h"
28 #include "accept_event_handler.h"
29 #include "event_loop.h"
35 ipc_server(const std::string &path);
38 bool set_option(int option, int value);
39 bool set_option(const std::string &option, int value);
41 bool bind(channel_handler *handler, event_loop *loop);
44 /* TODO: only accept_handler should use these functions */
45 void accept(ipc::socket &cli_sock);
46 void register_channel(int fd, channel *ch);
47 void register_acceptor(void);
50 stream_socket m_accept_sock;
52 event_loop *m_event_loop;
53 channel_handler *m_handler;
54 accept_event_handler *m_accept_handler;
59 #endif /* __IPC_SERVER_H__ */