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

35 lines
727 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::AddLightServerSession(KLightServerSession &lightServerSession)
{
KScopedCriticalSection critsec{};
if (isClientAlive || isServerAlive) {
return ResultKernelConnectionRefused();
} else {
return server.AddLightServerSession(lightServerSession);
}
}
}