summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_port.h
diff options
context:
space:
mode:
authorMax Romanov <max.romanov@nginx.com>2020-08-11 19:20:10 +0300
committerMax Romanov <max.romanov@nginx.com>2020-08-11 19:20:10 +0300
commit3cbc22a6dc45abdeade4deb364601230ddca02c1 (patch)
tree3eff409de1a4405c646a2c11633d50711fa22746 /src/nxt_port.h
parentbf647588ff781e606651f001b53a4e83bb34c000 (diff)
downloadunit-3cbc22a6dc45abdeade4deb364601230ddca02c1.tar.gz
unit-3cbc22a6dc45abdeade4deb364601230ddca02c1.tar.bz2
Changing router to application port exchange protocol.
The application process needs to request the port from the router instead of the latter pushing the port before sending a request to the application. This is required to simplify the communication between the router and the application and to prepare the router to use the application shared port and then the queue.
Diffstat (limited to '')
-rw-r--r--src/nxt_port.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/nxt_port.h b/src/nxt_port.h
index 0e8707f3..838a7ffe 100644
--- a/src/nxt_port.h
+++ b/src/nxt_port.h
@@ -25,6 +25,7 @@ struct nxt_port_handlers_s {
/* File descriptor exchange. */
nxt_port_handler_t change_file;
nxt_port_handler_t new_port;
+ nxt_port_handler_t get_port;
nxt_port_handler_t mmap;
/* New process */
@@ -77,6 +78,7 @@ typedef enum {
_NXT_PORT_MSG_CHANGE_FILE = nxt_port_handler_idx(change_file),
_NXT_PORT_MSG_NEW_PORT = nxt_port_handler_idx(new_port),
+ _NXT_PORT_MSG_GET_PORT = nxt_port_handler_idx(get_port),
_NXT_PORT_MSG_MMAP = nxt_port_handler_idx(mmap),
_NXT_PORT_MSG_PROCESS_CREATED = nxt_port_handler_idx(process_created),
@@ -107,6 +109,7 @@ typedef enum {
NXT_PORT_MSG_ACCESS_LOG = nxt_msg_last(_NXT_PORT_MSG_ACCESS_LOG),
NXT_PORT_MSG_CHANGE_FILE = nxt_msg_last(_NXT_PORT_MSG_CHANGE_FILE),
NXT_PORT_MSG_NEW_PORT = nxt_msg_last(_NXT_PORT_MSG_NEW_PORT),
+ NXT_PORT_MSG_GET_PORT = nxt_msg_last(_NXT_PORT_MSG_GET_PORT),
NXT_PORT_MSG_MMAP = nxt_msg_last(_NXT_PORT_MSG_MMAP)
| NXT_PORT_MSG_CLOSE_FD | NXT_PORT_MSG_SYNC,
@@ -238,6 +241,12 @@ typedef struct {
} nxt_port_msg_new_port_t;
+typedef struct {
+ nxt_port_id_t id;
+ nxt_pid_t pid;
+} nxt_port_msg_get_port_t;
+
+
/*
* nxt_port_data_t size is allocation size
* which enables effective reuse of memory pool cache.