[En-Nut-Discussion] NutUdpSendTo doesn't return

Christian.Schilmoeller at camco.de Christian.Schilmoeller at camco.de
Fri Sep 9 15:25:57 CEST 2005

Hello Ulrich,

I'm a Ethernut beginner, so I am not sure if I can help here. But I 
remember I've had a problem that looked similar:

I tried to send out data by NutTcpSend(). Ok, in your case it's UDP, but 
the mechanics behind it might be similar. This usually worked if the TCP 
socket was created by the main() thread.
But it also didn't work if the function was called by another thread 
(which got a pointer to a valid socket as parameter). The data just never 
went out.

Then I tried a different approach: I created a socket, established a 
connection on it and then associated a file stream with it (see ethernut 
example "tcps.c"). To send out data, I called fwrite() and then fflush(). 
Everything worked then, regardless if the functions were called from the 
main() or another thread.



More information about the En-Nut-Discussion mailing list