3 messages in net.java.dev.jna.usersTimeout on method call
FromSent OnAttachments
GalexApr 14, 2008 7:01 am 
Albert StrasheimApr 14, 2008 7:22 am 
GalexApr 14, 2008 11:55 pm 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Timeout on method callActions...
From:Galex (fire@gmail.com)
Date:Apr 14, 2008 7:01:44 am
List:net.java.dev.jna.users

Hello there,

I have a problem and I don't know if the JNA API can help or not. Basically what I would like to do, is to set a timeout on a method call.

In fact I have my library declaring some methods stored in the loaded DLL, and all is working just fine. But one method I'm calling can last up to many seconds. The problem is that I don't want this method to get stuck for a long time, stopping the execution of the rest of the java program.

I tried to make the call in a separate Thread but since it's only one method call (one line of code) and not a loop that will be executed many times, I can't really stop the Thread when the run method exceed the time I've fixed.

Notice that I can't touch to the DLL source code, it's not mine.

I searched through the JNA API but I did not find what i'm searching for (if there is).

If anybody can help me, it would be very nice :-).

Thanks in advance !