Files
UnrealEngineUWP/Engine/Source/Runtime/Online/WebSockets/Private/WebSocketsModule.cpp
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

46 lines
1.0 KiB
C++

// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved.
#include "WebSocketsModule.h"
#include "WebSocketsLog.h"
#if WITH_WEBSOCKETS
#include "PlatformWebSocket.h"
#endif // #if WITH_WEBSOCKETS
DEFINE_LOG_CATEGORY(LogWebSockets);
// FWebSocketsModule
IMPLEMENT_MODULE(FWebSocketsModule, WebSockets);
FWebSocketsModule* FWebSocketsModule::Singleton = nullptr;
void FWebSocketsModule::StartupModule()
{
Singleton = this;
}
void FWebSocketsModule::ShutdownModule()
{
Singleton = nullptr;
}
FWebSocketsModule& FWebSocketsModule::Get()
{
return *Singleton;
}
#if WITH_WEBSOCKETS
TSharedRef<IWebSocket> FWebSocketsModule::CreateWebSocket(const FString& Url, const TArray<FString>& Protocols)
{
return MakeShareable(new FPlatformWebSocket(Url, Protocols));
}
TSharedRef<IWebSocket> FWebSocketsModule::CreateWebSocket(const FString& Url, const FString& Protocol)
{
TArray<FString> Protocols;
Protocols.Add(Protocol);
return MakeShareable(new FPlatformWebSocket(Url, Protocols));
}
#endif // #if WITH_WEBSOCKETS