diff options
author | Mattias Andrée <maandree@operamail.com> | 2014-05-19 21:40:23 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2014-05-19 21:40:26 +0200 |
commit | b4cd5273bccc8ae09da2a60a11a7c9946fc2d9db (patch) | |
tree | 6bb4576534aa9c1aa014e63bef6191cb08bcf0a8 | |
parent | m + store master thread (diff) | |
download | mds-b4cd5273bccc8ae09da2a60a11a7c9946fc2d9db.tar.gz mds-b4cd5273bccc8ae09da2a60a11a7c9946fc2d9db.tar.bz2 mds-b4cd5273bccc8ae09da2a60a11a7c9946fc2d9db.tar.xz |
add broadcast support
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r-- | doc/messages | 8 | ||||
-rw-r--r-- | src/mds-server/mds-server.c | 12 |
2 files changed, 16 insertions, 4 deletions
diff --git a/doc/messages b/doc/messages index 48c6b73..8dd583c 100644 --- a/doc/messages +++ b/doc/messages @@ -105,8 +105,14 @@ assumed that the client's ID is 0:0. Clients automatically receives messages that is -addressed to them with priority zero and mark that +addressed to them with priority zero with a mark that it will not modify the message. To address a message to client include the header ‘To’ with the client's ID [that the message is addressed to] as the value. +Furthermore, client's automatically receives messages +that include the header ‘To: all’ — a broadcast. Since +servers are clients too they will also receive these +messages; there are two exceptions, the kernel and +the master server, neither of which are servers proper, +but rather a dual-layer kernel. diff --git a/src/mds-server/mds-server.c b/src/mds-server/mds-server.c index 55db770..3179ee7 100644 --- a/src/mds-server/mds-server.c +++ b/src/mds-server/mds-server.c @@ -259,13 +259,19 @@ void* slave_loop(void* data) size_t information_address = fd_table_get(&client_map, (size_t)socket_fd); client_t* information = (client_t*)(void*)information_address; char* msgbuf = NULL; + char buf[] = "To: all"; size_t n; int r; - /* Intiailsie the client. */ - if (information == NULL) - fail_if ((information = initialise_client(socket_fd)) == NULL); + if (information == NULL) /* Did not re-exec. */ + { + /* Initialise the client. */ + fail_if ((information = initialise_client(socket_fd)) == NULL); + + /* Register client to receive broadcasts. */ + add_intercept_condition(information, buf, 0, 0, 0); + } /* Store slave thread and create mutexes and conditions. */ fail_if (client_initialise_threading(information)); |