meso: Implement ConnectLight

This commit is contained in:
TuxSH
2018-11-13 01:14:55 +01:00
committed by Michael Scire
parent efe7325af3
commit ad879ca327
12 changed files with 73 additions and 18 deletions

View File

@@ -1,4 +1,5 @@
#include <mesosphere/processes/KLightSession.hpp>
#include <mesosphere/processes/KPort.hpp>
#include <mesosphere/core/KCoreContext.hpp>
namespace mesosphere
@@ -8,14 +9,24 @@ KLightSession::~KLightSession()
{
}
Result KLightSession::Initialize()
Result KLightSession::Initialize(KPort *parentPort)
{
SetClientServerParent();
isClientAlive = true;
isServerAlive = true;
SetResourceOwner(KCoreContext::GetCurrentInstance().GetCurrentProcess());
return ResultSuccess();
if (parentPort == nullptr) {
return ResultSuccess();
} else {
// Another difference with official kernel: if adding the session fails, the session isn't added to allocator set (since it'll be deleted right away).
Result res = parentPort->AddLightServerSession(server);
if (res.IsSuccess()) {
client.parentClientPort = &parentPort->GetClient();
}
return res;
}
}
void KLightSession::Terminate(bool fromServer)