Frustration with ofxUDPManager

Hi,

I’m getting a bit frustrated with my implementation of ofxUDPManager.
I have a weird situation where i build the app, successfully receiving UDP messages and the next day after a build i don’t receive any UDP messages… I successfully tested with netcat if there are any UDP messages to receive, so that should not be the problem.

I was thinking that maybe the UDP manager was listening on the wrong interface? For example my macbook has an ethernet interface and an wifi interface that both have an different ip addresses. So it may be that the manager got confused and started listening on the wireless interface instead of the ethernet’s? But i don’t really know enough of UDP or the ofxUDPManager to know it’s inner workings.

The UDP manager is set up as in the example, it only has to receive a string.

// in ofApp.h
ofxUDPManager connection;

// in ofApp.cpp
void ofApp::setup()
{    
   connection.Create();
   connection.Bind(11999);
   connection.SetNonBlocking(true);
}

void ofApp::update()
{
   char udpMessage[100000];
   connection.Receive(udpMessage,100000);
   string data = udpMessage;

   // After the message is received  i dissect the line with an regex
}

So with this set up i had successful tests and it worked. Until this morning, and the only thing i changed was the ofBackground() color! :stuck_out_tongue:

I did some searching on the forum and tried the following set up as well:

char udpMessage[100000];
string data;
int bytesReceived = connection.Receive(udpMessage,10);
if(bytesReceived>0){
    data[bytesReceived] = '\0';
    data = udpMessage;
}

The thing i find the strangest is that i did not alter the set up in any way and now it suddenly doesn’t work any more… Also the UDP packets come flying in as i can see them with netcat… having my hands in my hair with this one.

If you guys have any ideas, i really appreciate the help!

Thanks,
Bram