meso: impl AddServerSession

This commit is contained in:
TuxSH
2018-11-12 15:48:03 +01:00
committed by Michael Scire
parent 173bde2eca
commit efe7325af3
5 changed files with 40 additions and 3 deletions

View File

@@ -1,5 +1,6 @@
#include <mesosphere/processes/KPort.hpp>
#include <mesosphere/core/KCoreContext.hpp>
#include <mesosphere/threading/KScopedCriticalSection.hpp>
namespace mesosphere
{
@@ -8,13 +9,27 @@ KPort::~KPort()
{
}
Result KPort::Initialize()
Result KPort::Initialize(int maxSessions, bool isLight)
{
SetClientServerParent();
isClientAlive = true;
isServerAlive = true;
client.maxSessions = maxSessions;
this->isLight = isLight;
return ResultSuccess();
}
Result KPort::AddServerSession(KLightServerSession &lightServerSession)
{
KScopedCriticalSection critsec{};
if (isClientAlive || isServerAlive) {
return ResultKernelConnectionRefused();
} else {
return server.AddServerSession(lightServerSession);
}
}
}