Created
July 12, 2016 02:29
-
-
Save define-private-public/aab810577cdb9ff3af59570fc68c2566 to your computer and use it in GitHub Desktop.
Example usage of IPEndPoint
This file contains hidden or 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
// Filename: IPEndPointExample.cs | |
// Author: Benjamin N. Summerton <define-private-public> | |
// License: Unlicense (http://unlicense.org/) | |
using System; | |
using System.Net; | |
namespace IPEndPointExample | |
{ | |
class IPEndPointExample | |
{ | |
public static void Main(string[] args) | |
{ | |
// Print some static info | |
Console.WriteLine("Min. Port: {0}", IPEndPoint.MinPort); | |
Console.WriteLine("Max. Port: {0}", IPEndPoint.MaxPort); | |
Console.WriteLine(); | |
// Create one | |
IPEndPoint endPoint = new IPEndPoint(IPAddress.Parse("107.70.178.215"), 6000); | |
Console.WriteLine("Address: {0}", endPoint.Address); | |
Console.WriteLine("Port: {0}", endPoint.Port); | |
Console.WriteLine("Address Family: {0}", endPoint.AddressFamily); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment