I’m Curious about this issue…
I have been trying to create two applications. One application is for my Fez.Spider and the other is a Windows TaskTray application.
I am using UDP sockets and I can successfully sent text messages to the Spider from the TaskTray app. However, I have NOT been able
to figure out how to receive messages from the Spider.
I am using a NETGEAR WNCE2001 (WiFi Bridge) connected to the Spider ethernet module J11D.
(I am assuming that a ‘WiFi bridge’ is two way communication) Am I wrong?
In my quest to solve my failures in receiving messages sent from the Spider to the TaskTray…
I used Debug.Print to check the socket local and remote EndPoints I was using for my Spider ‘Listener’ method.
If I try to ‘read’ the Socket ‘RemoteEndPoint’ I loose the ability to receive data from my TaskTray application.
I added a Try/Catch and I do not receive any Exception.
Anybody know why this would occur?
Partial code where I loose the ability to receive.
Note that creating a string also causes the issue.
void SetupListener()
{
readSocket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
listenPortEndPoint = new IPEndPoint(IPAddress.Any, listenPort);
readSocket.Bind(listenPortEndPoint);
//This does not cause problems
if (useDebug) { Debug.Print("readSocket LocalEndPoint: " + readSocket.LocalEndPoint.ToString()); }
try
{
//Using either of the following prevents receiving data!!
// string test = readSocket.RemoteEndPoint.ToString();
//or using
// Debug.Print("readSocket RemoteEndPoint: " + readSocket.RemoteEndPoint.ToString());
}
catch (Exception onDebug) //No exception received
{
Debug.Print(onDebug.ToString());
}
listenerThread = new Thread(new ThreadStart(ListenIncomming));
listenerThread.Start();
}
//
Any help on receiving UDP at the TaskTray appreciated!
Have a GREAT DAY!