Description





Description

The IPEndPoint class contains the IP address of a host system and the number of a port to access on the host. The IPEndPoint class represents a connection point used by the System.Net.Sockets.Socket class.

Example
using System;

using System.Net;

using System.Net.Sockets;



public class IPEndPointSample

{

    public static void Main()

    {

        IPAddress addr = IPAddress.Parse("10.0.0.1");

        IPEndPoint ep = new IPEndPoint(addr, 80);

        Console.WriteLine("IPEndPoint(10.0.0.1, 80)"

            + ".AddressFamily = '{0}'",

            ep.AddressFamily);

        Console.WriteLine("Address = '{0}'",

            ep.Address);



        SocketAddress sktaddr = new

            SocketAddress(AddressFamily.InterNetwork);

        IPEndPoint newep = (IPEndPoint) ep.Create(sktaddr);

        Console.WriteLine("New IPEndPoint.AddressFamily = '{0}'",

            newep.AddressFamily);

        Console.WriteLine("New IPEndPoint.Address = '{0}'",

            newep.Address);

        Console.WriteLine();

        Console.WriteLine();

        Console.WriteLine("Press Enter to continue");

        Console.ReadLine();

    }

}






The output is

IPEndPoint(10.0.0.1, 80).AddressFamily = 'InterNetwork'

Address = '10.0.0.1'

New IPEndPoint.AddressFamily = 'InterNetwork'

New IPEndPoint.Address = '0.0.0.0'





Press Enter to continue



     Python   SQL   Java   php   Perl 
     game development   web development   internet   *nix   graphics   hardware 
     telecommunications   C++ 
     Flash   Active Directory   Windows