Skip to content

Commit

Permalink
Removed use of ListenSocketAddress
Browse files Browse the repository at this point in the history
  • Loading branch information
technige committed Feb 8, 2018
1 parent e69ea50 commit d733ff4
Showing 1 changed file with 12 additions and 3 deletions.
Expand Up @@ -112,9 +112,18 @@ public void start() throws Throwable
.bind( protocolInitializer.address().socketAddress() ).sync();
InetSocketAddress localAddress = (InetSocketAddress) channelFuture.channel().localAddress();
connectionRegister.register( boltConnector.key(), localAddress );
ListenSocketAddress listenSocketAddress = new ListenSocketAddress(
protocolInitializer.address().getHostname(), localAddress.getPort() );
log.info( "Bolt enabled on %s.", listenSocketAddress );
String host = protocolInitializer.address().getHostname();
int port = localAddress.getPort();
if ( host.contains( ":" ) )
{
// IPv6
log.info( "Bolt enabled on [%s]:%s.", host, port );
}
else
{
// IPv4
log.info( "Bolt enabled on %s:%s.", host, port );
}
}
catch ( Throwable e )
{
Expand Down

0 comments on commit d733ff4

Please sign in to comment.