summaryrefslogtreecommitdiff
path: root/Services/NotificationServer
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-09-12 11:44:00 +0200
committerAndreas Kling <kling@serenityos.org>2020-09-12 14:49:29 +0200
commitaba793fb3e1096cd05867cb9217226f93975e33f (patch)
treefa29878a96f7d5de54297283e1752dfeac635061 /Services/NotificationServer
parent633e0bc9443aaa248fcc7faa583304ae5215755f (diff)
downloadserenity-aba793fb3e1096cd05867cb9217226f93975e33f.zip
LibIPC: Share most of the code between {Client,Server}Connection
This patch introduces IPC::Connection which becomes the new base class of ClientConnection and ServerConnection. Most of the functionality has been hoisted up to the base class since almost all of it is useful on both sides. This gives us the ability to send synchronous messages in both directions, which is needed for the WebContent server process. Unlike other servers, WebContent does not mind blocking on a response from its client.
Diffstat (limited to 'Services/NotificationServer')
-rw-r--r--Services/NotificationServer/ClientConnection.cpp2
-rw-r--r--Services/NotificationServer/ClientConnection.h3
2 files changed, 3 insertions, 2 deletions
diff --git a/Services/NotificationServer/ClientConnection.cpp b/Services/NotificationServer/ClientConnection.cpp
index f90878efe2..9c6cc8051a 100644
--- a/Services/NotificationServer/ClientConnection.cpp
+++ b/Services/NotificationServer/ClientConnection.cpp
@@ -34,7 +34,7 @@ namespace NotificationServer {
static HashMap<int, RefPtr<ClientConnection>> s_connections;
ClientConnection::ClientConnection(NonnullRefPtr<Core::LocalSocket> client_socket, int client_id)
- : IPC::ClientConnection<NotificationServerEndpoint>(*this, move(client_socket), client_id)
+ : IPC::ClientConnection<NotificationClientEndpoint, NotificationServerEndpoint>(*this, move(client_socket), client_id)
{
s_connections.set(client_id, *this);
}
diff --git a/Services/NotificationServer/ClientConnection.h b/Services/NotificationServer/ClientConnection.h
index 8ea04bbfff..af4e36d0aa 100644
--- a/Services/NotificationServer/ClientConnection.h
+++ b/Services/NotificationServer/ClientConnection.h
@@ -27,11 +27,12 @@
#pragma once
#include <LibIPC/ClientConnection.h>
+#include <NotificationServer/NotificationClientEndpoint.h>
#include <NotificationServer/NotificationServerEndpoint.h>
namespace NotificationServer {
-class ClientConnection final : public IPC::ClientConnection<NotificationServerEndpoint>
+class ClientConnection final : public IPC::ClientConnection<NotificationClientEndpoint, NotificationServerEndpoint>
, public NotificationServerEndpoint {
C_OBJECT(ClientConnection)
public: