Hi
I am working with UDP socket.
Using udpEcho example, I could write my application without problem.
But, when I tried to send a datagram from another thread using sendto(), always this function returned -1.
The problem was that the same routine that sends the buffer through sendto() works with the thread that received a buffer using recvfrom(), but does not work from another thread that doesn't receive anything.
Googling a lot, I found some posts that discussed this kind of issue. And, in one, I found that we need to place "fdOpenSession(TaskSelf())" in the beginning of the routine that sends the datagram and "fdCloseSession(TaskSelf());" at the end.
I did it and it WORKED!!!!
That's amazing, but, I don't have a minimum idea why it worked.
Can someone explan why "fdOpenSession(TaskSelf())" works?
Thanks.
Sergio