1
0
Fork 0
mirror of https://github.com/Atmosphere-NX/Atmosphere.git synced 2024-11-15 00:16:48 +00:00
Atmosphere/mesosphere/source/processes/KPort.cpp

36 lines
717 B
C++
Raw Normal View History

2018-11-12 13:52:57 +00:00
#include <mesosphere/processes/KPort.hpp>
#include <mesosphere/core/KCoreContext.hpp>
2018-11-12 14:48:03 +00:00
#include <mesosphere/threading/KScopedCriticalSection.hpp>
2018-11-12 13:52:57 +00:00
namespace mesosphere
{
KPort::~KPort()
{
}
2018-11-12 14:48:03 +00:00
Result KPort::Initialize(int maxSessions, bool isLight)
2018-11-12 13:52:57 +00:00
{
SetClientServerParent();
isClientAlive = true;
isServerAlive = true;
2018-11-12 14:48:03 +00:00
client.maxSessions = maxSessions;
this->isLight = isLight;
2018-11-12 13:52:57 +00:00
return ResultSuccess();
}
2018-11-12 14:48:03 +00:00
Result KPort::AddServerSession(KLightServerSession &lightServerSession)
{
KScopedCriticalSection critsec{};
if (isClientAlive || isServerAlive) {
return ResultKernelConnectionRefused();
} else {
return server.AddServerSession(lightServerSession);
}
}
2018-11-12 13:52:57 +00:00
}