createPrimingSocket(socketGroupInfo, connectAddress.getHostName(), connectPort,
bindAddress, bindPort, socketFactory, getTimeout());
// We got socketGroupInfo by socketGroupId. Make sure it is also stored by AddressPair.
connectHost = connectAddress.getHostName();
addressPair = new AddressPair(connectHost, connectPort, bindHost, bindPort);
addressPairMap.put(addressPair, socketGroupInfo);
return;
}
connectHost = (String) parameters.get(MULTIPLEX_CONNECT_HOST_KEY);
connectPortString = (String) parameters.get(MULTIPLEX_CONNECT_PORT_KEY);
if (connectHost != null && connectPortString == null)
{
throw new IOException("multiplexConnectHost != null and multiplexConnectPort == null");
}
if (connectHost == null && connectPortString != null)
{
throw new IOException("multiplexConnectHost == null and multiplexConnectPort != null");
}
// server rule 2.
if (connectHost != null)
{
log.debug("server rule 2");
isVirtual = true;
try
{
connectPort = Integer.parseInt(connectPortString);
}
catch (NumberFormatException e)
{
throw new IOException("number format error for callbackPort: " + connectPortString);
}
connectSocketAddress = new InetSocketAddress(connectHost, connectPort);
addressPair = new AddressPair(connectHost, connectPort, bindHost, bindPort);
socketGroupInfo = (SocketGroupInfo) addressPairMap.get(addressPair);
// If socketGroupInfo exists, it's because it was created, along with a priming socket (if necessary),
// by a MultiplexClientInvoker.
if (socketGroupInfo != null)