meso: impl AddServerSession
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user