try {
server = new ServerSocket(desc.getPort(), desc.getBacklog(),
host == null ? null
: InetAddress.getByName(host));
} catch (IOException e) {
throw new ConnectionSetupException(e.toString());
}
acceptingDescription = connectionDescription;
tcpNoDelay = desc.getTcpNoDelay();
} else if (!connectionDescription.equals(acceptingDescription)) {
throw new AlreadyAcceptingException(acceptingDescription
+ " vs. "
+ connectionDescription);
}
serv = server;
}
Socket socket;
try {
socket = serv.accept();
if (DEBUG) {
System.err.println("##### " + getClass().getName()
+ ".accept: accepted " + socket);
}
if (tcpNoDelay != null) {
socket.setTcpNoDelay(tcpNoDelay.booleanValue());
}
return new SocketConnection(acceptingDescription, socket);
}
catch(IOException e) {
throw new ConnectionSetupException(e.toString());
}
}