native UDP implementation for android
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 开发者_JS百科than 32 byte and the application crashed.
Does anyone has a clue what could cause the stack corruption?
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
精彩评论