System.Net.IPEndPoint Class

Assembly: System.dll
Namespace: System.Net
Summary
Represents a network endpoint as an IP address and a port number.
C# Syntax:
[Serializable]
public class IPEndPoint : EndPoint
Remarks
The IPEndPoint class contains the host and port information needed by an application to connect to a service on a host. By combining the host's IP address and port number of a service, the IPEndPoint class forms a connection point to a service.
See also:
System.Net Namespace

System.Net.IPEndPoint Member List:

Public Constructors
ctor #1 Overloaded:
.ctor(long address, int port)

Initializes a new instance of the IPEndPoint class with the specified address and port number.
ctor #2 Overloaded:
.ctor(IPAddress address, int port)

Initializes a new instance of the IPEndPoint class with the specified address and port number.
Public Fields
MaxPort Specifies the maximum value that can be assigned to the IPEndPoint.Port property. This field is read-only.
MinPort Specifies the minimum value that can be assigned to the IPEndPoint.Port property. This field is read-only.
Public Properties
Address Read-write

Gets or sets the IP address of the endpoint.
AddressFamily Read-only

Overridden:
Gets the Internet Protocol (IP) address family.
Port Read-write

Gets or sets the TCP port number of the endpoint.
Public Methods
Create Overridden:
Creates an endpoint from a socket address.
Equals Overridden:
GetHashCode Overridden:
GetType
(inherited from System.Object)
See base class member description: System.Object.GetType

Derived from System.Object, the primary base class for all objects.
Serialize Overridden:
Serializes endpoint information into a SocketAddress instance.
ToString Overridden:
Returns the IP address and port number for the specified endpoint.
Protected Methods
Finalize
(inherited from System.Object)
See base class member description: System.Object.Finalize

Derived from System.Object, the primary base class for all objects.
MemberwiseClone
(inherited from System.Object)
See base class member description: System.Object.MemberwiseClone

Derived from System.Object, the primary base class for all objects.

Hierarchy:


System.Net.IPEndPoint Member Details

Overloaded ctor #1
Summary
Initializes a new instance of the IPEndPoint class with the specified address and port number.
C# Syntax:
public IPEndPoint(
   long address,
   int port
);
Parameters:

address

The IP address of the Internet host.

port

The port number associated with the address, or 0 to specify any available port.

Exceptions
Exception Type Condition
ArgumentOutOfRangeException port is less than IPEndPoint.MinPort.

-or-

port is greater than IPEndPoint.MaxPort.

Return to top


Overloaded ctor #2
Summary
Initializes a new instance of the IPEndPoint class with the specified address and port number.
C# Syntax:
public IPEndPoint(
   IPAddress address,
   int port
);
Parameters:

address

An IPAddress.

port

The port number associated with address.

Exceptions
Exception Type Condition
ArgumentOutOfRangeException port is less than IPEndPoint.MinPort.

-or-

port is greater than IPEndPoint.MaxPort.

ArgumentNullException address is null.

Return to top


Field: MaxPort
Summary
Specifies the maximum value that can be assigned to the IPEndPoint.Port property. This field is read-only.
C# Syntax:
public const int MaxPort;

Return to top


Field: MinPort
Summary
Specifies the minimum value that can be assigned to the IPEndPoint.Port property. This field is read-only.
C# Syntax:
public const int MinPort;

Return to top


Property: Address (read-write)
Summary
Gets or sets the IP address of the endpoint.
C# Syntax:
public IPAddress Address {get; set;}

Return to top


Overridden Property: AddressFamily (read-only)
Summary
Gets the Internet Protocol (IP) address family.
C# Syntax:
public override AddressFamily AddressFamily {get;}
See also:
EndPoint

Return to top


Property: Port (read-write)
Summary
Gets or sets the TCP port number of the endpoint.
C# Syntax:
public int Port {get; set;}

Return to top


Overridden Method: Create(
   SocketAddress socketAddress
)
Summary
Creates an endpoint from a socket address.
C# Syntax:
public override EndPoint Create(
   SocketAddress socketAddress
);
Parameters:

socketAddress

The SocketAddress to use for the endpoint.

Return Value:
An EndPoint instance using the specified socket address.
See also:
EndPoint | SocketAddress

Return to top


Overridden Method: Equals(
   object comparand
)
C# Syntax:
public override bool Equals(
   object comparand
);
Parameters:

comparand

Return to top


Method: Finalize()
Inherited
See base class member description: System.Object.Finalize
C# Syntax:
~IPEndPoint();

For more information on members inherited from System.Object click on the link above.

Return to top


Overridden Method: GetHashCode()
C# Syntax:
public override int GetHashCode();

Return to top


Method: GetType()
Inherited
See base class member description: System.Object.GetType
C# Syntax:
public Type GetType();

For more information on members inherited from System.Object click on the link above.

Return to top


Method: MemberwiseClone()
Inherited
See base class member description: System.Object.MemberwiseClone
C# Syntax:
protected object MemberwiseClone();

For more information on members inherited from System.Object click on the link above.

Return to top


Overridden Method: Serialize()
Summary
Serializes endpoint information into a SocketAddress instance.
C# Syntax:
public override SocketAddress Serialize();
Return Value:
A SocketAddress instance containing the socket address for the endpoint.
See also:
EndPoint

Return to top


Overridden Method: ToString()
Summary
Returns the IP address and port number for the specified endpoint.
C# Syntax:
public override string ToString();
Return Value:
A string containing the IP address, in dotted-quad notation, and the port number for the specified endpoint (for example, 192.168.1.2:23).

Return to top


Top of page

Copyright (c) 2002 Microsoft Corporation. All rights reserved.