/** * Returns the absolute source port for this outbound socket binding. The absolute source port is the same as {@link #getSourcePort()} * if the outbound socket binding is marked for "fixed source port". Else, it is the sum of {@link #getSourcePort()} * and the port offset configured on the {@link SocketBindingManager}. * * @return the absolute source port accounting for port offset/fixation; {@code null} if an ephemeral port should be used */ public Integer getAbsoluteSourcePort() { if (this.getSourcePort() == null) { return null; } if (this.fixedSourcePort) { return this.sourcePort; } final int portOffset = this.socketBindingManager.getPortOffset(); return this.sourcePort + portOffset; }
NetworkUtils.canonize(binding.getSourceAddress().getHostAddress())); if (binding.getSourcePort() != null) {
NetworkUtils.canonize(binding.getSourceAddress().getHostAddress())); if (binding.getSourcePort() != null) {