This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Problem using network sockets from two tasks

We have two tasks.

Task A creates and configures a raw socket then loops over recvnc() and send().  In other words, its an echo loop.  There is a conditional compile to use getsendncbuff() and sendnc(), instead of send().

Task B features a loop that takes input from the UPP and attempts to call send() (or as above, getsendncbuff() and sendnc()).

The call from Task B, to send() or getsendncbuff(), returns an “unknown error”.  That is to say, the call fails and then fdError() returns -1.

Why is the attempt to send a packet failing from Task B?

What is the easiest solution?

What is the most efficient solution?

 

 

P.S. A similar issue was posted two years ago, in http://e2e.ti.com/support/dsp/tms320c6000_high_performance_dsps/f/112/p/11373/44221.aspx#44221.  Note there that other customers added posts to repeat the question in each of the two years since then.  It was never answered.

  • The answer is that the second task has to call fdOpenSession() and then call fdShare(). The second task has to do this after the first task has opened the socket.

     

    The function fdShare() is documented in exactly one place, and that is the Programmer’s Reference Guide, page 52.   There is no description whatsoever of how to use it and there are no examples of how to use it.   The only clue is in  ndk/src/tools/console/conipv6.c, which I found by using grep on the entirety of the ndk and nsp trees.

  • Mitch,

     

    This is great news that you've gotten past this issue.  I’m sorry that you had to tear your hair out trying to figure out the solution to this problem; being a developer myself, I know how frustrating that can be.

     

    I have filed a bug for that so that this issue won’t get lost:

     

    SDOCM00082348  NDK documentation needs improved description of fdShare() API

     Thanks,

    Steve