Skip to content

Commit

Permalink
include attempted bind address in DotNetty binding failure messages (#…
Browse files Browse the repository at this point in the history
…5132)

* close #5130 - include attempted bind address in binding failure messages

* forgot to add semicolon

* added inner exception back

* added note about InnerException containing descriptive socket error
  • Loading branch information
Aaronontheweb authored Jul 6, 2021
1 parent 951be4a commit 0a21bc2
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/core/Akka.Remote/Transport/DotNetty/DotNettyTransport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,19 @@ protected async Task<IChannel> NewServer(EndPoint listenAddress)
if (InternalTransport != TransportMode.Tcp)
throw new NotImplementedException("Haven't implemented UDP transport at this time");

if (listenAddress is DnsEndPoint dns)
try
{
listenAddress = await DnsToIPEndpoint(dns).ConfigureAwait(false);
}
if (listenAddress is DnsEndPoint dns)
{
listenAddress = await DnsToIPEndpoint(dns).ConfigureAwait(false);
}

return await ServerFactory().BindAsync(listenAddress).ConfigureAwait(false);
return await ServerFactory().BindAsync(listenAddress).ConfigureAwait(false);
}
catch (Exception ex)
{
throw new RemoteTransportException($"Failed to bind to [{listenAddress}]. See InnerException for details.", ex);
}
}

public override async Task<(Address, TaskCompletionSource<IAssociationEventListener>)> Listen()
Expand Down

0 comments on commit 0a21bc2

Please sign in to comment.