1
0
Fork 0
mirror of https://github.com/Atmosphere-NX/Atmosphere.git synced 2024-11-14 16:06:56 +00:00
Atmosphere/mesosphere/source/processes/KPort.cpp
2019-06-03 17:41:08 -07:00

35 lines
717 B
C++

#include <mesosphere/processes/KPort.hpp>
#include <mesosphere/core/KCoreContext.hpp>
#include <mesosphere/threading/KScopedCriticalSection.hpp>
namespace mesosphere
{
KPort::~KPort()
{
}
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);
}
}
}