* (2) Use the routers from config to get their exits.
*/
private void createExits() {
final Config conf = getLocalConfig();
String hostName;
HostId hostId;
// (1) Get all the _HOSTS_ from the config file.
for (String hostKey : conf.keys("host")) {
if (getExitCount() >= this.maximumExitCount) {
break;
}
hostName = conf.get(hostKey, null);
if (null != hostName) {
try {
hostId = new HostId(hostName);
createExit(hostId);
}
catch (IOException exc) {
// Host not reachable or rejected. No problem.
}
}
}
// (2) Get all the _ROUTERS_ from config file.
for (String routerKey : conf.keys("router")) {
hostName = conf.get(routerKey, null);
if (null != hostName) {
try {
hostId = new HostId(hostName);
createExitsFromRouter(hostId);
}
catch (IOException exc) {
// Host was not reachable. Skip it.
if (AgentopiaConstants.NETWORK_DEBUG) {