Ark Server API (ASA) - Wiki
Loading...
Searching...
No Matches
WindowsPlatformNamedPipe.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreTypes.h"
6#include "GenericPlatform/GenericPlatformNamedPipe.h"
7#include "Windows/WindowsSystemIncludes.h"
8
9
11
12class FString;
13
14
15// Windows wrapper for named pipe communications
16class FWindowsPlatformNamedPipe
17 : public FGenericPlatformNamedPipe
18{
19public:
20
21 FWindowsPlatformNamedPipe();
22 virtual ~FWindowsPlatformNamedPipe();
23
24 FWindowsPlatformNamedPipe(const FWindowsPlatformNamedPipe&) = delete;
25 FWindowsPlatformNamedPipe& operator=(const FWindowsPlatformNamedPipe&) = delete;
26
27public:
28
29 // FGenericPlatformNamedPipe overrides
30
31 virtual bool Create(const FString& PipeName, bool bAsServer, bool bAsync) override;
32 virtual bool Destroy() override;
33 virtual bool OpenConnection() override;
34 virtual bool BlockForAsyncIO() override;
35 virtual bool IsReadyForRW() const override;
36 virtual bool UpdateAsyncStatus() override;
37 virtual bool WriteBytes(int32 NumBytes, const void* Data) override;
38 virtual bool ReadBytes(int32 NumBytes, void* OutData) override;
39 virtual bool IsCreated() const override;
40 virtual bool HasFailed() const override;
41
42private:
43
44 void* Pipe;
45 Windows::OVERLAPPED Overlapped;
46 double LastWaitingTime;
47 bool bUseOverlapped : 1;
48 bool bIsServer : 1;
49
50 enum EState
51 {
52 State_Uninitialized,
53 State_Created,
54 State_Connecting,
55 State_ReadyForRW,
56 State_WaitingForRW,
57
58 State_ErrorPipeClosedUnexpectedly,
59 };
60
61 EState State;
62
63 bool UpdateAsyncStatusAfterRW();
64};
65
66
67typedef FWindowsPlatformNamedPipe FPlatformNamedPipe;
68
69#endif // PLATFORM_SUPPORTS_NAMED_PIPES
#define PLATFORM_SUPPORTS_NAMED_PIPES
Definition Platform.h:405