1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-29 23:07:48 +02:00
Files
vcmi/lib/network/NetworkHandler.h

34 lines
1006 B
C++
Raw Normal View History

2024-01-12 01:10:41 +02:00
/*
* NetworkHandler.h, part of VCMI engine
*
* Authors: listed in file AUTHORS in main folder
*
* License: GNU General Public License v2.0 or later
* Full text of license available in license.txt file, in main folder
*
*/
#pragma once
#include "NetworkDefines.h"
VCMI_LIB_NAMESPACE_BEGIN
2025-06-28 21:42:54 +03:00
class NetworkHandler final : public INetworkHandler
2024-01-12 01:10:41 +02:00
{
2025-06-29 16:26:23 +03:00
std::unique_ptr<NetworkContext> context;
2024-01-12 01:10:41 +02:00
public:
NetworkHandler();
std::unique_ptr<INetworkServer> createServerTCP(INetworkServerListener & listener) override;
2024-01-12 16:55:36 +02:00
void connectToRemote(INetworkClientListener & listener, const std::string & host, uint16_t port) override;
void createInternalConnection(INetworkClientListener & listener, INetworkServer & server) override;
2025-06-28 21:42:54 +03:00
std::shared_ptr<INetworkConnection> createAsyncConnection(INetworkConnectionListener & listener) override;
2024-01-12 01:10:41 +02:00
void createTimer(INetworkTimerListener & listener, std::chrono::milliseconds duration) override;
void run() override;
void stop() override;
};
VCMI_LIB_NAMESPACE_END