This repository has been archived on 2024-11-16. You can view files and clone it, but cannot push or open issues or pull requests.
Unreal-RedNetwork/Source/ThirdParty/KCP/Public/KCPWrap.h
_Redstone_c_ 39be28a997 优化 FKCPWrap
修复 Log 乱码
允许直接获取 KCPCB
添加 DebugName 区分不同 KCP 对象
2021-01-03 17:28:53 +08:00

57 lines
912 B
C++

#pragma once
#include "CoreMinimal.h"
#include "ikcp.h"
class KCP_API FKCPWrap
{
public:
FKCPWrap(uint32 Conv);
FKCPWrap(uint32 Conv, const FString& InDebugName);
~FKCPWrap();
ikcpcb& GetKCPCB();
int Recv(uint8* Data, int32 Count);
int Send(const uint8* Data, int32 Count);
void Update(uint32 Current);
void Check(uint32 Current) const;
int Input(const uint8* Data, int32 Count);
void Flush();
int PeekSize() const;
int SetMTU(int32 MTU = 1400);
int SetWindowSize(int32 SentWindow = -1, int32 RecvWindow = -1);
int GetWaitSent() const;
int SetNoDelay(int32 NoDelay = -1, int32 Internal = -1, int32 FastResend = -1, int32 NC = -1);
int SetNormalMode();
int SetTurboMode();
TFunction<int32(const uint8* Data, int32 Count)> OutputFunc;
void SetDebugName(const FString& InDebugName);
const FString& GetDebugName() const;
private:
ikcpcb* KCPPtr;
FString DebugName;
};