Q:

c# uwp client server connection send string

I have a problem with 2 uwp apps : one client and one server to communicate.
I have a textbox and a button on each.
The server side is like this :
listenerSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
IPEndPoint ipEnd = new IPEndPoint(IPAddress.Parse("127.0.0.1"), 8888);
listenerSocket.NoDelay = true;
listenerSocket.Bind(ipEnd);
listenerSocket.Listen(0);

and on ButtonClick
Socket clientSocket = listenerSocket.Accept();
Byte[] Buffer = new byte[clientSocket.SendBufferSize];
int readByte = clientSocket.Receive(Buffer);
txtEvents.Text = readByte.ToString();

On the client side is like this 
client= new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
IPEndPoint ipEnd = new IPEndPoint(IPAddress.Parse("127.0.0.1"), 8888);

and on buttonClick_Event
client.Connect(ipEnd);
client.Send(System.Text.Encoding.UTF8.GetBytes("Hey");

But nothing is happen.
Thanks for your help
best regards

A:

As the document Note part:

As a consequence of network isolation, Windows disallows
  establishing a socket connection (Sockets or WinSock) between two UWP
  apps running on the same machine; whether that's via the local
  loopback address (127.0.0.0), or by explicitly specifying the local IP
  address.

You can try to test your socket on two devices which deploy the client and server respectively.
Besides, you can also enable loopback for network access and troubleshoot network isolation issues, please see the How to enable loopback and troubleshoot network isolation topic to get details.

