-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #32 from LeeCampbell/HistogramFactory
Adding HistogramFactory. Updated RecorderExample
- Loading branch information
Showing
28 changed files
with
969 additions
and
188 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
using System; | ||
using System.Net; | ||
using System.Net.Sockets; | ||
|
||
namespace HdrHistogram.Examples | ||
{ | ||
/// <summary> | ||
/// A class used to test opening and closing a TCP socket. | ||
/// </summary> | ||
public class SocketTester | ||
{ | ||
private readonly Lazy<AddressFamily> _addressFamily; | ||
public SocketTester(string url) | ||
{ | ||
_addressFamily = new Lazy<AddressFamily>(() => GetAddressFamily(url)); | ||
} | ||
|
||
public void CreateAndCloseDatagramSocket() | ||
{ | ||
try | ||
{ | ||
using (var socket = new Socket(_addressFamily.Value, SocketType.Stream, ProtocolType.Tcp)) | ||
{ | ||
} | ||
} | ||
catch (SocketException) | ||
{ | ||
} | ||
} | ||
|
||
|
||
private static AddressFamily GetAddressFamily(string url) | ||
{ | ||
var hostIpAddress = Dns.GetHostEntry(url).AddressList[0]; | ||
var hostIpEndPoint = new IPEndPoint(hostIpAddress, 80); | ||
return hostIpEndPoint.AddressFamily; | ||
} | ||
} | ||
} |
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
Oops, something went wrong.