[+] ISocketServer::GetSessionCount
This commit is contained in:
parent
74b1e560bb
commit
52b49986f3
@ -12,6 +12,7 @@ namespace Aurora::IO::Net
|
||||
struct ISocketServer : virtual ISocketBase
|
||||
{
|
||||
virtual AuList<AuSPtr<ISocket>> GetChildren() = 0;
|
||||
virtual AuUInt32 GetSessionCount() = 0;
|
||||
virtual AuSPtr<ISocketServerLimits> GetLimits() = 0;
|
||||
virtual AuSPtr<ISocketServerDriver> GetServerDriver() = 0;
|
||||
};
|
||||
|
@ -153,6 +153,11 @@ namespace Aurora::IO::Net
|
||||
return ret;
|
||||
}
|
||||
|
||||
AuUInt32 SocketServer::GetSessionCount()
|
||||
{
|
||||
return this->childrenSockets.size();
|
||||
}
|
||||
|
||||
void SocketServer::OnNotifyChildCreated(SocketBase *pSocket)
|
||||
{
|
||||
{
|
||||
|
@ -38,6 +38,7 @@ namespace Aurora::IO::Net
|
||||
AuSPtr<ISocketDriverFactory> GetFactory();
|
||||
AuSPtr<ISocketServerLimits> GetLimits() override;
|
||||
AuList<AuSPtr<ISocket>> GetChildren() override;
|
||||
AuUInt32 GetSessionCount() override;
|
||||
|
||||
virtual void FinishConstructAsync() override;
|
||||
|
||||
|
@ -88,4 +88,17 @@ namespace Aurora::IO::Net
|
||||
return {};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
AuUInt32 NetDatagramEmulatorISocketServer::GetSessionCount()
|
||||
{
|
||||
if (auto pParent = this->pParent)
|
||||
{
|
||||
return pParent->GetSessionCount();
|
||||
}
|
||||
else
|
||||
{
|
||||
return {};
|
||||
}
|
||||
}
|
||||
}
|
@ -31,5 +31,6 @@ namespace Aurora::IO::Net
|
||||
AuSPtr<ISocketServerLimits> GetLimits() override;
|
||||
AuList<AuSPtr<ISocket>> GetChildren() override;
|
||||
AuSPtr<INetWorker> GetLockedWorkerThread() override;
|
||||
AuUInt32 GetSessionCount() override;
|
||||
};
|
||||
}
|
@ -226,6 +226,11 @@ namespace Aurora::IO::Net
|
||||
return ret;
|
||||
}
|
||||
|
||||
AuUInt32 NetDatagramSocketServer::GetSessionCount()
|
||||
{
|
||||
return this->sessions.size();
|
||||
}
|
||||
|
||||
AuSPtr<INetWorker> NetDatagramSocketServer::GetLockedWorkerThread()
|
||||
{
|
||||
if (auto pWorker = this->pWorker_)
|
||||
|
@ -39,6 +39,7 @@ namespace Aurora::IO::Net
|
||||
void Cleanup(const AuSPtr<NetDatagramSocketServerSession> &pSession);
|
||||
AuList<AuSPtr<NetDatagramSocketServerSession>> GetAllSessions();
|
||||
AuList<AuSPtr<ISocket>> GetAllChildren();
|
||||
AuUInt32 GetSessionCount();
|
||||
|
||||
AuSPtr<NetDatagramSocketServerDriver> ToDriver();
|
||||
AuSPtr<ISocketServer> ToSocketServer();
|
||||
|
Loading…
Reference in New Issue
Block a user