-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make the hostname in the endpoint configurable
- Loading branch information
1 parent
be0e400
commit d89d67e
Showing
3 changed files
with
37 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,13 @@ | ||
using System; | ||
using System.Net; | ||
|
||
namespace Abc.Zebus.Transport | ||
namespace Abc.Zebus.Transport | ||
{ | ||
internal readonly struct ZmqEndPoint | ||
{ | ||
private readonly string? _value; | ||
|
||
public ZmqEndPoint(string? value) | ||
{ | ||
if (value?.StartsWith("tcp://0.0.0.0:", StringComparison.OrdinalIgnoreCase) == true) | ||
{ | ||
var fqdn = Dns.GetHostEntry(string.Empty).HostName; | ||
_value = value.Replace("0.0.0.0", fqdn); | ||
} | ||
else | ||
{ | ||
_value = value; | ||
} | ||
} | ||
=> _value = value; | ||
|
||
public override string ToString() | ||
{ | ||
return _value ?? "tcp://*:*"; | ||
} | ||
=> _value ?? "tcp://*:*"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters