List of usage examples for org.springframework.integration.ip AbstractInternetProtocolReceivingChannelAdapter setLocalAddress
@Override public void setLocalAddress(String localAddress)
From source file:org.springframework.integration.ip.util.SocketTestUtils.java
public static void setLocalNicIfPossible(AbstractInternetProtocolReceivingChannelAdapter adapter) throws UnknownHostException { InetAddress[] nics = InetAddress.getAllByName(null); if (nics.length > 0) { // just listen on the loopback interface String loopBack = nics[0].getHostAddress(); adapter.setLocalAddress(loopBack); }// w ww . j ava 2s.c om }