Show / Hide Table of Contents

Class NetworkUtils

Inheritance
System.Object
NetworkUtils
Namespace: Eco.Shared.Networking
Assembly: Eco.Shared.dll
Syntax
public static class NetworkUtils : Object

Methods

GetBroadcastAddress()

Declaration
public static IPAddress GetBroadcastAddress()
Returns
Type Description
System.Net.IPAddress

GetGatewayAddresses()

Declaration
public static IEnumerable<IPAddress> GetGatewayAddresses()
Returns
Type Description
System.Collections.Generic.IEnumerable<System.Net.IPAddress>

GetOwnIPAddress()

Declaration
public static IPAddress GetOwnIPAddress()
Returns
Type Description
System.Net.IPAddress

GetOwnIPAddresses()

Declaration
public static IEnumerable<IPAddress> GetOwnIPAddresses()
Returns
Type Description
System.Collections.Generic.IEnumerable<System.Net.IPAddress>

IsOwnIPAddress(IPAddress)

Declaration
public static bool IsOwnIPAddress(IPAddress ipAddress)
Parameters
Type Name Description
System.Net.IPAddress ipAddress
Returns
Type Description
System.Boolean

IsPrivateIPAddress(IPAddress)

Declaration
public static bool IsPrivateIPAddress(IPAddress ipAddress)
Parameters
Type Name Description
System.Net.IPAddress ipAddress
Returns
Type Description
System.Boolean

IsPublicIPAddress(IPAddress)

Declaration
public static bool IsPublicIPAddress(IPAddress ipAddress)
Parameters
Type Name Description
System.Net.IPAddress ipAddress
Returns
Type Description
System.Boolean

ParseIPEndPoint(String)

Declaration
public static IPEndPoint ParseIPEndPoint(this string endpoint)
Parameters
Type Name Description
System.String endpoint
Returns
Type Description
System.Net.IPEndPoint

TryResolve(String, Int32, out IPEndPoint)

Declaration
public static bool TryResolve(string hostAndOptionalPort, int defaultPort, out IPEndPoint endpoint)
Parameters
Type Name Description
System.String hostAndOptionalPort
System.Int32 defaultPort
System.Net.IPEndPoint endpoint
Returns
Type Description
System.Boolean

TryResolve(String, out IPAddress)

Resolves IP address or host name to IPAddress object. If '*' used then it will auto-discovery remote address using https://www.ipify.org/.

Declaration
public static bool TryResolve(string ipOrHost, out IPAddress address)
Parameters
Type Name Description
System.String ipOrHost
System.Net.IPAddress address
Returns
Type Description
System.Boolean

V4OrV6(IEnumerable<IPAddress>)

Filters addresses to include only IPv4 and IPv6 addresses.

Declaration
public static IEnumerable<IPAddress> V4OrV6(this IEnumerable<IPAddress> addresses)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<System.Net.IPAddress> addresses
Returns
Type Description
System.Collections.Generic.IEnumerable<System.Net.IPAddress>
☀
☾
In This Article
Back to top
Copyright (c) Strange Loop Games 2021
☀
☾