-
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: do not resolve ip addresses
Make sure that if a remote IP address is specified, do not DNS resolve it.
- Loading branch information
1 parent
73bbc75
commit 99a2dea
Showing
6 changed files
with
67 additions
and
16 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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using System; | ||
using System.Net; | ||
|
||
namespace Serilog.Sinks.Udp.Private | ||
{ | ||
internal class RemoteEndPoint | ||
{ | ||
public RemoteEndPoint(string address, int port) | ||
{ | ||
if (port < IPEndPoint.MinPort || port > IPEndPoint.MaxPort) throw new ArgumentOutOfRangeException(nameof(port)); | ||
|
||
Address = address ?? throw new ArgumentNullException(nameof(address)); | ||
Port = port; | ||
|
||
if (IPAddress.TryParse(address, out var ipAddress)) | ||
{ | ||
IPEndPoint = new IPEndPoint(ipAddress, port); | ||
} | ||
} | ||
|
||
public string Address { get; } | ||
|
||
public int Port { get; } | ||
|
||
public IPEndPoint IPEndPoint { get; } | ||
} | ||
} |
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
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