# Udp sockets code gives errors located in SharedPointer.h and IPAdrress.h?

**URL:** <https://forums.unrealengine.com/t/udp-sockets-code-gives-errors-located-in-sharedpointer-h-and-ipadrress-h/428537>\
**Category:** Multiplayer & Networking\
**Tags:** udp, Networking, errors, unreal-engine, UE4, question\
**Created:** [July 2, 2018, 2:34pm UTC](https://forums.unrealengine.com/t/udp-sockets-code-gives-errors-located-in-sharedpointer-h-and-ipadrress-h/428537 "2018-07-02T14:34:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_05f3c6be](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_05f3c6be](https://forums.unrealengine.com/u/anonymous_user_05f3c6be)\
**Post date:** [July 2, 2018, 2:34pm UTC](https://forums.unrealengine.com/t/udp-sockets-code-gives-errors-located-in-sharedpointer-h-and-ipadrress-h/428537/1 "2018-07-02T14:34:27Z")

</div>

![245973-unreal-errors.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/a/3/1a32cbeab3e76f2cfab115a9586d4db95fc7769e.png)

I am getting this errors when compiling my udp socket client program.  
In project.build.cs i added “Sockets”, “Networking” as dependencies.  
The include lines work fine in visual studio:  
#include “Networking.h”  
#include “Sockets.h”  
#include “SocketSubsystem.h”  
Any advice would be appreciated.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_05f3c6be](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_05f3c6be](https://forums.unrealengine.com/u/anonymous_user_05f3c6be)\
**Post date:** [July 3, 2018, 1:41pm UTC](https://forums.unrealengine.com/t/udp-sockets-code-gives-errors-located-in-sharedpointer-h-and-ipadrress-h/428537/2 "2018-07-03T13:41:05Z")

</div>

Found the solution:  
you cant use TSharedRef addr; for ISocketSubsystem::Get(PLATFORM\_SOCKETSUBSYSTEM)-\>CreateInternetAddr();  
There are some posts on this forum that suggest you can but in the latest versions it seams not to work. The simple solution is just to use TSharedPtr Addr;
