views:

109

answers:

2

I'm trying to use native implementation of UDP server/client on Android, I'm using JNI to access the native code from java.

The code was tested successfully on Android 1.5 (HTC Hero) but when I tried to run the same application on Android 2.1 (HTC Legend) I got "Stack Corruption Detected" every time I received a packet bigger than 32 byte and the application crashed.

Does anyone has a clue what could cause the stack corruption?

A: 

Hi, Did you get you get any solution for this issue? Even I'm facing this problem.

Regards, Nand

Nand
A: 

I found two possible solutions: 1. Use read instead of recvfrom() 2. When compiling the source code use the android libraries and headers from your ndk. Just add the header files directories to the header search path in the makefile.

Hope it helps

Eli