Answer the question
In order to leave comments, you need to log in
How to establish UDP connection with emulator under WIN CE?
There is a WIN CE emulator running on a virtual machine (the network is configured via NAT).
If the client is located on the emulator
try
{
var client = new UdpClient();
IPEndPoint ep = new IPEndPoint(IPAddress.Parse("10.0.1.252"), 11000);
client.Connect(ep);
client.Send(new byte[] { 1, 2, 3, 4, 5 }, 5);
var receivedData = client.Receive(ref ep);
string msg = String.Format("receive data from " + ep.ToString());
MessageBox.Show(msg);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
UdpClient udpServer = new UdpClient(11000);
while (true)
{
var remoteEP = new IPEndPoint(IPAddress.Any, 11000);
var data = udpServer.Receive(ref remoteEP);
string msg = String.Format("receive data from " + remoteEP.ToString());
MessageBox.Show(msg);
udpServer.Send(new byte[] { 1 }, 1, remoteEP);
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question