I have created a UDP client and it works great. The data is coming back in the correct format (verified through wireshark). The problem is the format I receive from streamreader is not what I expected.
Here is the code
private async void OnMessageReceived(DatagramSocket sender,
DatagramSocketMessageReceivedEventArgs args)
{
Debug.WriteLine("message recv");
var result = args.GetDataStream();
var resultStream = result.AsStreamForRead(1024);
using (var reader = new StreamReader(resultStream))
{
string text = await reader.ReadToEndAsync();
Debug.WriteLine(text);
}
}
Here is the wireshark data
00 00 ff ff
Here is the text that is generated when I run my code
"?\0\u0002\0?\0\0d\0\0\u0001\u0001\0\0??"
I am assuming its a formatting issue.