1 
2 /*
3  * Copyright (C) Max Romanov
4  * Copyright (C) NGINX, Inc.
5  */
6 
7 #ifndef _NXT_PORT_RPC_H_INCLUDED_
8 #define _NXT_PORT_RPC_H_INCLUDED_
9 
10 
11 typedef void (*nxt_port_rpc_handler_t)(nxt_task_t *task,
12     nxt_port_recv_msg_t *msg, void *data);
13 
14 nxt_int_t nxt_port_rpc_init(void);
15 
16 uint32_t nxt_port_rpc_register_handler(nxt_task_t *task, nxt_port_t *port,
17     nxt_port_rpc_handler_t ready_handler, nxt_port_rpc_handler_t error_handler,
18     nxt_pid_t peer, void *data);
19 void *nxt_port_rpc_register_handler_ex(nxt_task_t *task, nxt_port_t *port,
20     nxt_port_rpc_handler_t ready_handler, nxt_port_rpc_handler_t error_handler,
21     size_t ex_size);
22 
23 uint32_t nxt_port_rpc_ex_stream(void *ex);
24 void nxt_port_rpc_ex_set_peer(nxt_task_t *task, nxt_port_t *port,
25     void *ex, nxt_pid_t peer);
26 
27 void nxt_port_rpc_handler(nxt_task_t *task, nxt_port_recv_msg_t *msg);
28 void nxt_port_rpc_remove_peer(nxt_task_t *task, nxt_port_t *port,
29     nxt_pid_t peer);
30 void nxt_port_rpc_cancel(nxt_task_t *task, nxt_port_t *port, uint32_t stream);
31 void nxt_port_rpc_close(nxt_task_t *task, nxt_port_t *port);
32 
33 
34 #endif /* _NXT_PORT_RPC_H_INCLUDED_ */
35 
36