I have a program that's using the FFMPEG binary libraries via JNI. There is a call to open a URL which is blocking in native code, and I need to allow the user to manually cancel this connection. Sometimes Thread.interrupt() works just like it's supposed to (if the url I'm connecting to is "udp://{whatever}"). If my URL is "rtp://{whatever}", Thread.interrupt() doesn't appear to be honored by the native thread. Thread.kill() doesn't even seem to do it (and is generally frowned on anyhow).
Does anyone know a different way to interrupt or kill a native thread through JNI?