Files
UnrealEngineUWP/Engine/Source/Runtime/Sockets/Private/Unix/SocketSubsystemUnix.h
Ryan Gerleve 35e095a9d8 Copying //UE4/Dev-Networking @ CL 11201841 to Dev-Main (//UE4/Dev-Main)
#rb none
#rnx

[CL 11202190 by Ryan Gerleve in Main branch]
2020-01-31 18:46:22 -05:00

60 lines
1.7 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "BSDSockets/SocketSubsystemBSD.h"
#include "SocketSubsystemPackage.h"
class Error;
class FInternetAddr;
/**
* Unix specific socket subsystem implementation
*/
class FSocketSubsystemUnix : public FSocketSubsystemBSD
{
protected:
/** Single instantiation of this subsystem */
static FSocketSubsystemUnix* SocketSingleton;
/** Whether Init() has been called before or not */
bool bTriedToInit;
PACKAGE_SCOPE:
/**
* Singleton interface for this subsystem
* @return the only instance of this subsystem
*/
static FSocketSubsystemUnix* Create();
/**
* Performs Unix specific socket clean up
*/
static void Destroy();
public:
FSocketSubsystemUnix()
: bTriedToInit(false)
{
}
virtual ~FSocketSubsystemUnix()
{
}
// ISocketSubsystem
virtual bool Init(FString& Error) override;
virtual void Shutdown() override;
virtual bool HasNetworkDevice() override;
virtual class FSocket* CreateSocket(const FName& SocketType, const FString& SocketDescription, const FName& ProtocolType) override;
virtual bool GetLocalAdapterAddresses(TArray<TSharedPtr<FInternetAddr> >& OutAddresses) override;
virtual class FSocketBSD* InternalBSDSocketFactory( SOCKET Socket, ESocketType SocketType, const FString& SocketDescription, const FName& SocketProtocol) override;
virtual TUniquePtr<FRecvMulti> CreateRecvMulti(int32 MaxNumPackets, int32 MaxPacketSize, ERecvMultiFlags Flags) override;
virtual bool IsSocketRecvMultiSupported() const override;
virtual double TranslatePacketTimestamp(const FPacketTimestamp& Timestamp, ETimestampTranslation Translation) override;
};