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.

some confusion about the ndk client example



Hi, I am starting using ndk and now debuging the client example, there are some confusion about this example:
1. in client.c file, there is a header file: console.h, which should be under the path ti/ndk/inc/tools, but I can't find it. where is it?
2. in the client.c, the function NetworkOpen() implement some DaemonNew to startup local server, but I can't find the callback (such as
dtask_tcp_echo, dtask_tcp_datasrv, etc). where are they being implemented?

  • A1. The header file is there, please double check, e.g., C:\ti\ndk_2_22_03_20\packages\ti\ndk\inc\tools\console.h

    A2. it is inside client.c file

    static

    void NetworkOpen()

    {

    // Create our local servers

    hEcho =

    DaemonNew( SOCK_STREAMNC, 0, 7, dtask_tcp_echo,

    OS_TASKPRINORM, OS_TASKSTKNORM, 0, 3 );

    hEchoUdp =

    DaemonNew( SOCK_DGRAM, 0, 7, dtask_udp_echo,

    OS_TASKPRINORM, OS_TASKSTKNORM, 0, 1 );

    hData =

    DaemonNew( SOCK_STREAM, 0, 1000, dtask_tcp_datasrv,

    OS_TASKPRINORM, OS_TASKSTKNORM, 0, 3 );

    hNull =

    DaemonNew( SOCK_STREAMNC, 0, 1001, dtask_tcp_nullsrv,

    OS_TASKPRINORM, OS_TASKSTKNORM, 0, 3 );

    hOob =

    DaemonNew( SOCK_STREAMNC, 0, 999, dtask_tcp_oobsrv,

    OS_TASKPRINORM, OS_TASKSTKNORM, 0, 3 );

     

    Regards, Eric