Page 1 of 1

Problems with UDP Send unicast

Posted: Mon Jan 12, 2009 12:53 pm
by navydev
I have two threads running, one receives a mulicast message at 50 hz, the other sends a message at 1 hz unicast. The Send function in the send thread stops sending at intermittent times. Could run for thirty minutes, could run for 15 minutes, could run for 1 minute.

Has anyone come across this problem, and if so, did you find out what was causing this bizarre behaviour? I know the send thread is still executing, I put a debug statement to print right after the call to Send, and it prints everytime. The receive thread chugs along nicely and processes all messages it receives.

Re: Problems with UDP Send unicast

Posted: Mon Jan 12, 2009 1:12 pm
by hendrixj
by "stops sending" do you mean it generates an error, or quietly stops sending. my initial suspicion is that you are filling up the receive buffer (because you are sending so much faster).

can you include the code?

John

Re: Problems with UDP Send unicast

Posted: Tue Jan 13, 2009 6:08 am
by navydev
Thank you for the response, it is appreciated. I am sending 1 message per second and there is no error being generated. I actually wish there was. The Send function is a void function and does not
return a value. The receive thread is receiving at 50 times per second and continues to receive long after the Send function stops sending. I am baffled.

Re: Problems with UDP Send unicast

Posted: Tue Jan 13, 2009 9:30 am
by rnixon
UDP is normally a send and forget type of packet. At this point I would break out wireshark and look at the outgoing udp packets from the netburner.

Re: Problems with UDP Send unicast

Posted: Tue Jan 13, 2009 9:41 am
by navydev
I have been running WireShark and the packets are exactly what is being sent from within the code. Wireshark does capture them, but at intermittent times they just are not seen on the wire. I do have debug statements in the while loop just after the send function is called and it prints everytime so I know that the Send function is at least trying to execute. It just seems like the netburner device is closing the unicast port I am sending on for no apparent reason.

Re: Problems with UDP Send unicast

Posted: Thu Jan 15, 2009 7:55 pm
by rnixon
What are the priorites of each task? Could it be that the multicast task is getting more data than you think, and is not letting the other task run? One test could be to just enable the sending task and see what effect it has.