Table of Contents

Class SocketAddress

Namespace
System.Net
Assembly
System.Net.dll

Stores serialized information from EndPoint derived classes.

public class SocketAddress
Inheritance
SocketAddress
Inherited Members
Extension Methods

Constructors

SocketAddress(AddressFamily, int)

Creates a new instance of the SocketAddress class using the specified address family and buffer size.

public SocketAddress(AddressFamily family, int size)

Parameters

family AddressFamily

An AddressFamily enumerated value.

size int

The number of bytes to allocate for the underlying buffer.

Remarks

Use this overload to create a new instance of the SocketAddress class with a particular underlying buffer size.

Properties

Family

Gets the address family for the current address.

public AddressFamily Family { get; }

Property Value

AddressFamily

A value specifying the addressing scheme that is used to resolve the current address.

this[int]

Gets or sets the specified index element in the underlying buffer.

public byte this[int offset] { get; set; }

Parameters

offset int

The array index element of the desired information.

Property Value

byte

The value of the specified index element in the underlying buffer.

Remarks

This property gets or sets the specified byte position in the underlying buffer.

Size

Gets the underlying buffer size of the SocketAddress.

public int Size { get; }

Property Value

int

The underlying buffer size of the SocketAddress.

Remarks

This property gets the underlying buffer size of the SocketAddress in bytes.

Methods

Equals(object)

Determines whether the specified object is equal to the current object.

public override bool Equals(object obj)

Parameters

obj object

he object to compare with the current object.

Returns

bool

true if the specified object is equal to the current object; otherwise, false.

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int

A hash code for the current object.