The problem is that my server is written in the old Framework, so I can not use SocketStream there, I use System.Net.Sockets.TcpClient instead. The Client is written in the new framework, where TcpClient and the whole System.Net.Sockets are not supported. In the new framework we have Windows.Networking.Sockets. The exact question is: How to send data from the Client to the Server?
Here is what happens when the user clicks on Send button:
var writer = new DataWriter(socket.OutputStream);
writer.WriteString(message);
var ret = await writer.StoreAsync();
writer.DetachStream();
LogMessage(string.Format("Sent (to {0}) {1}", socket.Information.RemoteHostName.DisplayName, message));
At server side:
srReceiver = new System.IO.StreamReader(tcpClient.GetStream());
strResponse = srReceiver.ReadLine();