super(orb, useSelectThreadToWait, useWorkerThread);
// REVISIT - probably need a contact info for both
// client and server for removing connections from cache?
this.contactInfo = contactInfo;
boolean isBlocking = !useSelectThreadToWait;
SocketInfo socketInfo =
// REVISIT - case - needs interface method
((SocketFactoryContactInfoImpl)contactInfo).socketInfo;
try {
socket =
orb.getORBData().getLegacySocketFactory().createSocket(socketInfo);
socketChannel = socket.getChannel();
if (socketChannel != null) {
socketChannel.configureBlocking(isBlocking);
} else {
// IMPORTANT: non-channel-backed sockets must use
// dedicated reader threads.
setUseSelectThreadToWait(false);
}
if (orb.transportDebugFlag) {
dprint(".initialize: connection created: " + socket);
}
} catch (GetEndPointInfoAgainException ex) {
throw wrapper.connectFailure(
ex, socketInfo.getType(), socketInfo.getHost(),
Integer.toString(socketInfo.getPort())) ;
} catch (Exception ex) {
throw wrapper.connectFailure(
ex, socketInfo.getType(), socketInfo.getHost(),
Integer.toString(socketInfo.getPort())) ;
}
state = OPENING;