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.

ndk2.0 question! look for help

hi,

I am using ndk2.0 and 6747 develop a udp application, i send a udp packet who's  length less than 10k is sucessful,but when i send packet who's length larger than 10k ,socket api "sendto" return -1,and fdError() return 55.

is there some setup in ndk or socket?how i can send packet larger than 10k?

thanks you!!!

  • Hi feng yantsing,

    The message you are seeing means that the NDK is trying to allocate the packet but is failing because it is running out of memory.  It means that either the PBM (packet buffer manager) has run out of available packets from its pool, or that that NDK's memory manager does not have any blocks available in its pool.

    Can you try the following?

    1. Copy the NDK source file "ndk_2_0_0\packages\ti\ndk\src\os\pbm.c" into your project.
    2. Increase the value for PKT_NUM_FRAMEBUF from 192 to some greater value (e.g. start with 200 and keep increasing if you need more).
    3. Rebuild your project

    Let me know if you see build errors.  By copying that file into your project and rebuilding there, I'm hoping to avoid you having to rebuild the NDK stack (i.e. it's a shortcut).

    You may also need to increase the available memory pool.  This is done in a similar way in the file mem.c but by changing the value of RAW_PAGE_COUNT from 16 to be a bigger number (try 20 first and work up from there).

    But again, if you get build errors (mulitply defined symbol errors) from copying these files into your project, then please let me know and we'll try another way.

    Steve