// Get local host address
if (localAddr == null) {
try {
long sa = Address.get(Socket.APR_LOCAL, socket);
Sockaddr addr = new Sockaddr();
if (Address.fill(addr, sa)) {
localAddr = addr.hostname;
localPort = addr.port;
}
} catch (Exception e) {
log.warn("Exception getting socket information " ,e);
}
}
request.localAddr().setString(localAddr);
} else if (actionCode == ActionCode.ACTION_REQ_REMOTEPORT_ATTRIBUTE) {
// Get remote port
if (remotePort == -1) {
try {
long sa = Address.get(Socket.APR_REMOTE, socket);
Sockaddr addr = Address.getInfo(sa);
remotePort = addr.port;
} catch (Exception e) {
log.warn("Exception getting socket information " ,e);
}
}
request.setRemotePort(remotePort);
} else if (actionCode == ActionCode.ACTION_REQ_LOCALPORT_ATTRIBUTE) {
// Get local port
if (localPort == -1) {
try {
long sa = Address.get(Socket.APR_LOCAL, socket);
Sockaddr addr = new Sockaddr();
if (Address.fill(addr, sa)) {
localAddr = addr.hostname;
localPort = addr.port;
}
} catch (Exception e) {