Пересмотр асинхронностей
This commit is contained in:
@@ -24,7 +24,8 @@ struct ParsedPacket {
|
||||
virtual ~ParsedPacket();
|
||||
};
|
||||
|
||||
class ServerSession : public AsyncObject, public IServerSession, public ISurfaceEventListener {
|
||||
class ServerSession : public IServerSession, public ISurfaceEventListener {
|
||||
asio::io_context &IOC;
|
||||
std::unique_ptr<Net::AsyncSocket> Socket;
|
||||
IRenderSession *RS = nullptr;
|
||||
DestroyLock UseLock;
|
||||
@@ -56,10 +57,10 @@ class ServerSession : public AsyncObject, public IServerSession, public ISurface
|
||||
public:
|
||||
// Нужен сокет, на котором только что был согласован игровой протокол (asyncInitGameProtocol)
|
||||
ServerSession(asio::io_context &ioc, std::unique_ptr<Net::AsyncSocket> &&socket, IRenderSession *rs = nullptr)
|
||||
: AsyncObject(ioc), Socket(std::move(socket)), RS(rs), NetInputPackets(1024)
|
||||
: IOC(ioc), Socket(std::move(socket)), RS(rs), NetInputPackets(1024)
|
||||
{
|
||||
assert(Socket.get());
|
||||
co_spawn(run());
|
||||
asio::co_spawn(IOC, run(), asio::detached);
|
||||
}
|
||||
|
||||
virtual ~ServerSession();
|
||||
|
||||
Reference in New Issue
Block a user