# How can I get FSocket working?

**URL:** <https://forums.unrealengine.com/t/how-can-i-get-fsocket-working/291414>\
**Category:** Multiplayer & Networking\
**Tags:** Networking, fsocket, unreal-engine, CPP, question\
**Created:** [August 19, 2014, 1:26pm UTC](https://forums.unrealengine.com/t/how-can-i-get-fsocket-working/291414 "2014-08-19T13:26:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kyaem](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@kyaem](https://forums.unrealengine.com/u/kyaem)\
**Post date:** [August 19, 2014, 1:26pm UTC](https://forums.unrealengine.com/t/how-can-i-get-fsocket-working/291414/1 "2014-08-19T13:26:16Z")

</div>

I use version 4.4 preview.

and i saw lots of post about socket network.

i just want to make an echo client.

but it’s not working many problems…

i added Build.cs PublicDependencyModuleNames “Sockets”

then i include that cause when it doesn’t exist i have to see properties error

```
#include "Runtime/Networking/Public/Interfaces/IPv4/IPv4Address.h"
#include "Runtime/Networking/Public/Interfaces/IPv4/IPv4SubnetMask.h"
#include "Runtime/Sockets/Public/Sockets.h"
#include "Runtime/Sockets/Public/SocketSubsystem.h"
#include "Runtime/Networking/Public/Common/TcpListener.h"
#include "Runtime/Core/Public/Templates/SharedPointer.h"

```

and that’s my source codes

```
Aa019GameMode::Aa019GameMode(const class FPostConstructInitializeProperties& PCIP)
	: Super(PCIP)
{
	// set default pawn class to our Blueprinted character
	static ConstructorHelpers::FClassFinder<APawn> PlayerPawnBPClass(TEXT("/Game/Blueprints/MyCharacter"));
	if (PlayerPawnBPClass.Class != NULL)
	{
		DefaultPawnClass = PlayerPawnBPClass.Class;
	}

	FSocket* Socket = ISocketSubsystem::Get(PLATFORM_SOCKETSUBSYSTEM)->CreateSocket(NAME_Stream, TEXT("default"), false);
	FString address = TEXT("127.0.0.1");
	int32 port = 19834;
	FIPv4Address ip;

	FIPv4Address::Parse(address, ip);

	TSharedRef addr = ISocketSubsystem::Get(PLATFORM_SOCKETSUBSYSTEM)->CreateInternetAddr();
	addr->SetIp(ip.GetValue());
	addr->SetPort(port);

	bool connected = Socket->Connect(*addr);

	FString serialized = TEXT("loadPlayer|1");
	TCHAR *serializedChar = serialized.GetCharArray().GetData();
	int32 size = FCString::Strlen(serializedChar);
	int32 sent = 0;

	bool successful = Socket->Send((uint8*)TCHAR_TO_UTF8(serializedChar), size, sent);

}

```

it’s doesn’t compile  
i need your help please.

---

<div class="post-metadata">

**Author:** ![gmpreussner\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@gmpreussner\_1](https://forums.unrealengine.com/u/gmpreussner_1)\
**Post date:** [August 19, 2014, 5:05pm UTC](https://forums.unrealengine.com/t/how-can-i-get-fsocket-working/291414/2 "2014-08-19T17:05:02Z")

</div>

What’s the error message when compiling?

---

<div class="post-metadata">

**Author:** ![gmpreussner\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@gmpreussner\_1](https://forums.unrealengine.com/u/gmpreussner_1)\
**Post date:** [August 27, 2014, 4:12pm UTC](https://forums.unrealengine.com/t/how-can-i-get-fsocket-working/291414/3 "2014-08-27T16:12:19Z")

</div>

Hello kaem, were you able to resolve this issue?
