Concerning the timeout policy.
JacORB_free JavaAPI source code has a server and a client projects. The server is extremely simple - it has only one attribute and a command - timeout - and simply answers after 15 seconds. Client connects to the server and executes the command.
Interesting enough that there is no timeout exception at all:
/usr/lib/jvm/java-8-openjdk-amd64/bin/java ...
>>>>>>>>>>> Oracle's ORBObject does not support custom timeouts!!!
1467123545446
>>>>>>>>>>> Oracle's ORBObject does not support custom timeouts!!!
1467123560470
Process finished with exit code 0
Client simply waits till command finishes its execution.
I wonder how long it can wait (150 000 also passes)?!
Exploring the source code I have found the following:
Oracle’s CORBA implementation uses ReadTCPTimeoutsImpl class as a storage for TCP related timeouts:
public class ReadTCPTimeoutsImpl implements ReadTimeouts
{
private int initial_time_to_wait;
private int max_time_to_wait;
private int max_giop_header_time_to_wait;
private double backoff_factor;
This class is created from special properties that can be passed to ORB during initialization. See this Oracle’s forum thread, for instance.
These timeout values are then used in MessageBase class to specify timeout for reading from connection (socket or channel):
//MessageBase.java
public static Message readGIOPBody(ORB orb,
CorbaConnection connection,
Message msg)
{
ReadTimeouts readTimeouts =
orb.getORBData().getTransportTCPReadTimeouts();
ByteBuffer buf = msg.getByteBuffer();
buf.position(MessageBase.GIOPMessageHeaderLength);
int msgSizeMinusHeader =
msg.getSize() - MessageBase.GIOPMessageHeaderLength;
try {
buf = connection.read(buf,
GIOPMessageHeaderLength, msgSizeMinusHeader,
readTimeouts.get_max_time_to_wait()); //HERE!!!
} catch (IOException e) {
throw wrapper.ioexceptionWhenReadingConnection(e);
}
No timeout exception even though default value is 3000 millis. Overriding these values via reflection does not give any effect
Maybe I have missed something.
Theoretically it is easy to implement our own timeout mechanism, e.g. start a thread that waits for a specified period of time and then closes the connection.
Any help will be appreciated.