Plasma Engine  2.0
Loading...
Searching...
No Matches
IpcChannelEnet.h
1#pragma once
2
3#include <Foundation/Basics.h>
4#include <Foundation/Communication/IpcChannel.h>
5
6#ifdef BUILDSYSTEM_ENABLE_ENET_SUPPORT
7
10
11class PL_FOUNDATION_DLL plIpcChannelEnet : public plIpcChannel
12{
13public:
14 plIpcChannelEnet(plStringView sAddress, Mode::Enum mode);
15 ~plIpcChannelEnet();
16
17protected:
18 virtual void InternalConnect() override;
19 virtual void InternalDisconnect() override;
20 virtual void InternalSend() override;
21 virtual bool NeedWakeup() const override;
22 virtual bool RequiresRegularTick() override { return true; }
23 virtual void Tick() override;
24 void NetworkMessageHandler(plRemoteMessage& msg);
25 void EnetEventHandler(const plRemoteEvent& e);
26
27 plString m_sAddress;
28 plString m_sLastAddress;
29 plTime m_LastConnectAttempt;
31};
32
33#endif
Base class for a communication channel between processes.
Definition IpcChannel.h:44
virtual bool RequiresRegularTick()
Override this and return true, if the surrounding infrastructure should call the 'Tick()' function.
Definition IpcChannel.h:104
virtual void InternalConnect()=0
Called on worker thread after Connect was called.
virtual void InternalDisconnect()=0
Called on worker thread after Disconnect was called.
virtual void Tick()
Can implement regular updates, e.g. for polling network state.
Definition IpcChannel.h:106
virtual bool NeedWakeup() const =0
Called by Send to determine whether the message loop need to be woken up.
virtual void InternalSend()=0
Called on worker thread to sent pending messages.
Definition RemoteInterface.h:60
Encapsulates all the data that is transmitted when sending or receiving a message with plRemoteInterf...
Definition RemoteMessage.h:11
plStringView represent a read-only sub-string of a larger string, as it can store a dedicated string ...
Definition StringView.h:34
A Unique ptr manages an object and destroys that object when it goes out of scope....
Definition UniquePtr.h:10
Event type for connections.
Definition RemoteInterface.h:33
The time class encapsulates a double value storing the time in seconds.
Definition Time.h:12