Problems with UDP Send unicast

Discussion to talk about software related topics only.
Post Reply
navydev
Posts: 7
Joined: Thu Dec 04, 2008 6:13 am

Problems with UDP Send unicast

Post 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.
Real Programmers comment code. If you can't explain it, you probably guessed.
hendrixj
Posts: 33
Joined: Thu Oct 23, 2008 11:39 am

Re: Problems with UDP Send unicast

Post 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
navydev
Posts: 7
Joined: Thu Dec 04, 2008 6:13 am

Re: Problems with UDP Send unicast

Post 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.
Real Programmers comment code. If you can't explain it, you probably guessed.
rnixon
Posts: 833
Joined: Thu Apr 24, 2008 3:59 pm

Re: Problems with UDP Send unicast

Post 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.
navydev
Posts: 7
Joined: Thu Dec 04, 2008 6:13 am

Re: Problems with UDP Send unicast

Post 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.
Real Programmers comment code. If you can't explain it, you probably guessed.
rnixon
Posts: 833
Joined: Thu Apr 24, 2008 3:59 pm

Re: Problems with UDP Send unicast

Post 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.
Post Reply