throw new org.omg.CORBA.COMM_FAILURE ("read() did not return any data");
}
long nanoDeadline = (time_out == 0 ? Long.MAX_VALUE : System.nanoTime() + time_out * 1000000);
ReadCallback callback = new ReadCallback (data, offset, min_length, max_length);
SelectorRequest request = new SelectorRequest (SelectorRequest.Type.READ, myChannel,
callback, nanoDeadline);
if (!selectorManager.add (request))
{
if (request.status == SelectorRequest.Status.EXPIRED)
{
throw new TIMEOUT("Message expired before write attempt.");
}
else
{
throw handleCommFailure(new IOException("Unable to add read request to SelectorManager"));
}
}
request.waitOnCompletion (nanoDeadline);
if (request.status == SelectorRequest.Status.EXPIRED || !request.isFinalized())
{
throw new TIMEOUT("Message expired before write attempt.");
}
else if (request.status == SelectorRequest.Status.FAILED)
{