Files
UnrealEngineUWP/Engine/Source/Runtime/Sockets/Private/Windows/SocketSubsystemWindows.h
Ben Marsh 20bf0eb6a1 Updating copyright notices to 2017 (copying from //Tasks/UE4/Dev-Copyright-2017).
#rb none
#lockdown Nick.Penwarden

[CL 3226823 by Ben Marsh in Main branch]
2016-12-08 08:52:44 -05:00

59 lines
1.5 KiB
C++

// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved.
#pragma once
#include "SocketSubsystem.h"
#include "BSDSockets/SocketSubsystemBSD.h"
#include "BSDSockets/SocketsBSD.h"
#include "SocketSubsystemPackage.h"
/**
* Windows specific socket subsystem implementation.
*/
class FSocketSubsystemWindows
: public FSocketSubsystemBSD
{
public:
/** Default constructor. */
FSocketSubsystemWindows() :
bTriedToInit(false)
{ }
/** Virtual destructor. */
virtual ~FSocketSubsystemWindows() { }
public:
// FSocketSubsystemBSD overrides
virtual class FSocket* CreateSocket(const FName& SocketType, const FString& SocketDescription, bool bForceUDP = false) override;
virtual bool HasNetworkDevice() override;
virtual ESocketErrors GetLastErrorCode() override;
virtual bool GetLocalAdapterAddresses( TArray<TSharedPtr<FInternetAddr> >& OutAdresses ) override;
virtual const TCHAR* GetSocketAPIName() const override;
virtual bool Init( FString& Error ) override;
virtual void Shutdown() override;
virtual ESocketErrors TranslateErrorCode( int32 Code ) override;
PACKAGE_SCOPE:
/**
* Singleton interface for this subsystem.
*
* @return the only instance of this subsystem.
*/
static FSocketSubsystemWindows* Create();
/** Performs Windows specific socket clean up. */
static void Destroy();
protected:
/** Holds a flag indicating whether Init() has been called before or not. */
bool bTriedToInit;
/** Holds the single instantiation of this subsystem. */
static FSocketSubsystemWindows* SocketSingleton;
};