diff options
author | Max Romanov <max.romanov@nginx.com> | 2017-08-02 13:14:31 +0300 |
---|---|---|
committer | Max Romanov <max.romanov@nginx.com> | 2017-08-02 13:14:31 +0300 |
commit | f2e9afdf422c1771d3029416c6284a46c4039781 (patch) | |
tree | f468d92f7055f53482abab254fd521aecafa6ec3 /src/nxt_port_rpc.h | |
parent | 3812ffd336414904affc43d29229b04a2d6d8ae6 (diff) | |
download | unit-f2e9afdf422c1771d3029416c6284a46c4039781.tar.gz unit-f2e9afdf422c1771d3029416c6284a46c4039781.tar.bz2 |
Port RPC interface introduced.
Usage:
1. Register handlers in incoming port with nxt_port_rpc_register_handler().
2. Use return value as a stream identifier for next nxt_port_socket_write().
Diffstat (limited to '')
-rw-r--r-- | src/nxt_port_rpc.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/nxt_port_rpc.h b/src/nxt_port_rpc.h new file mode 100644 index 00000000..cae20539 --- /dev/null +++ b/src/nxt_port_rpc.h @@ -0,0 +1,24 @@ + +/* + * Copyright (C) Max Romanov + * Copyright (C) NGINX, Inc. + */ + +#ifndef _NXT_PORT_RPC_H_INCLUDED_ +#define _NXT_PORT_RPC_H_INCLUDED_ + + +typedef void (*nxt_port_rpc_handler_t)(nxt_task_t *task, + nxt_port_recv_msg_t *msg, void *data); + +uint32_t nxt_port_rpc_register_handler(nxt_task_t *task, nxt_port_t *port, + nxt_port_rpc_handler_t ready_handler, nxt_port_rpc_handler_t error_handler, + nxt_pid_t peer, void *data); +void nxt_port_rpc_handler(nxt_task_t *task, nxt_port_recv_msg_t *msg); +void nxt_port_rpc_remove_peer(nxt_task_t *task, nxt_port_t *port, + nxt_pid_t peer); +void nxt_port_rpc_cancel(nxt_task_t *task, nxt_port_t *port, uint32_t stream); + + +#endif /* _NXT_PORT_RPC_H_INCLUDED_ */ + |