I have a Java application which uses a third-party COM component through a Java-COM bridge.
This COM component opens a socket connection to a remote host.
This host can take some time to respond, and I suspicious that I’m getting a timeout. I’m not sure because as I said, it’s a closed-source third-party component.
The API of this component does not expose the socket connection to me, so I have no way to configure the timeout. So I wonder if there is any way to tweak the system default timeout.
I’m using a Windows Server 2008 x64 Enterprise Edition.
Do you want to build your application so that it knows at runtime whether or not a timeout happened, or do you want to inspect the behavior of the closed-source COM component? If it’s the latter, install Wireshark on your dev box and watch the connection. If it’s the former, do you want to ensure that your Java call out to native land doesn’t hang forever? If that’s the case, look into the java.util.concurrent executor service stuff — there’s a way to call a method in another thread and wait a maximum of N seconds before returning control to your thread.