mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 02:17:34 +00:00
SQLServer: Add a hook to inform owners of disconnected SQL clients
This commit is contained in:
parent
fbf9cb3387
commit
5ece0a13c4
2 changed files with 5 additions and 0 deletions
|
@ -38,6 +38,9 @@ ConnectionFromClient::ConnectionFromClient(NonnullOwnPtr<Core::Stream::LocalSock
|
||||||
void ConnectionFromClient::die()
|
void ConnectionFromClient::die()
|
||||||
{
|
{
|
||||||
s_connections.remove(client_id());
|
s_connections.remove(client_id());
|
||||||
|
|
||||||
|
if (on_disconnect)
|
||||||
|
on_disconnect();
|
||||||
}
|
}
|
||||||
|
|
||||||
Messages::SQLServer::ConnectResponse ConnectionFromClient::connect(DeprecatedString const& database_name)
|
Messages::SQLServer::ConnectResponse ConnectionFromClient::connect(DeprecatedString const& database_name)
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <AK/DeprecatedString.h>
|
#include <AK/DeprecatedString.h>
|
||||||
|
#include <AK/Function.h>
|
||||||
#include <AK/HashMap.h>
|
#include <AK/HashMap.h>
|
||||||
#include <AK/Vector.h>
|
#include <AK/Vector.h>
|
||||||
#include <LibIPC/ConnectionFromClient.h>
|
#include <LibIPC/ConnectionFromClient.h>
|
||||||
|
@ -28,6 +29,7 @@ public:
|
||||||
static RefPtr<ConnectionFromClient> client_connection_for(int client_id);
|
static RefPtr<ConnectionFromClient> client_connection_for(int client_id);
|
||||||
|
|
||||||
void set_database_path(DeprecatedString);
|
void set_database_path(DeprecatedString);
|
||||||
|
Function<void()> on_disconnect;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
explicit ConnectionFromClient(NonnullOwnPtr<Core::Stream::LocalSocket>, int client_id);
|
explicit ConnectionFromClient(NonnullOwnPtr<Core::Stream::LocalSocket>, int client_id);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue