Files
UnrealEngineUWP/Engine/Source/Runtime/Sockets/Private/Android/SocketSubsystemAndroid.cpp

88 lines
1.9 KiB
C++
Raw Normal View History

// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
#include "SocketsPrivatePCH.h"
#include "SocketSubsystemAndroid.h"
#include "ModuleManager.h"
FSocketSubsystemAndroid* FSocketSubsystemAndroid::SocketSingleton = NULL;
FName CreateSocketSubsystem( FSocketSubsystemModule& SocketSubsystemModule )
{
FName SubsystemName(TEXT("ANDROID"));
// Create and register our singleton factor with the main online subsystem for easy access
FSocketSubsystemAndroid* SocketSubsystem = FSocketSubsystemAndroid::Create();
FString Error;
if (SocketSubsystem->Init(Error))
{
SocketSubsystemModule.RegisterSocketSubsystem(SubsystemName, SocketSubsystem);
return SubsystemName;
}
else
{
FSocketSubsystemAndroid::Destroy();
return NAME_None;
}
}
void DestroySocketSubsystem( FSocketSubsystemModule& SocketSubsystemModule )
{
SocketSubsystemModule.UnregisterSocketSubsystem(FName(TEXT("ANDROID")));
FSocketSubsystemAndroid::Destroy();
}
/**
* Singleton interface for the Android socket subsystem
* @return the only instance of the Android socket subsystem
*/
FSocketSubsystemAndroid* FSocketSubsystemAndroid::Create()
{
if (SocketSingleton == NULL)
{
SocketSingleton = new FSocketSubsystemAndroid();
}
return SocketSingleton;
}
/**
* Destroy the singleton Android socket subsystem
*/
void FSocketSubsystemAndroid::Destroy()
{
if (SocketSingleton != NULL)
{
SocketSingleton->Shutdown();
delete SocketSingleton;
SocketSingleton = NULL;
}
}
/**
* Does Android platform initialization of the sockets library
*
* @param Error a string that is filled with error information
*
* @return TRUE if initialized ok, FALSE otherwise
*/
bool FSocketSubsystemAndroid::Init(FString& Error)
{
return true;
}
/**
* Performs Android specific socket clean up
*/
void FSocketSubsystemAndroid::Shutdown(void)
{
}
/**
* @return Whether the device has a properly configured network device or not
*/
bool FSocketSubsystemAndroid::HasNetworkDevice()
{
return true;
}