Class NetUtils
Some specific network utilities
Assembly: LiteNetLib.dll
Syntax
public static class NetUtils
Methods
GetLocalIp(LocalAddrType)
Get first detected local ip address
Declaration
public static string GetLocalIp(LocalAddrType addrType)
Parameters
Type |
Name |
Description |
LocalAddrType |
addrType |
type of address (IPv4, IPv6 or both)
|
Returns
Type |
Description |
string |
IP address if available. Else - string.Empty
|
GetLocalIpList(LocalAddrType)
Get all local ip addresses
Declaration
public static List<string> GetLocalIpList(LocalAddrType addrType)
Parameters
Type |
Name |
Description |
LocalAddrType |
addrType |
type of address (IPv4, IPv6 or both)
|
Returns
Type |
Description |
List<string> |
List with all local ip addresses
|
GetLocalIpList(IList<string>, LocalAddrType)
Get all local ip addresses (non alloc version)
Declaration
public static void GetLocalIpList(IList<string> targetList, LocalAddrType addrType)
Parameters
MakeEndPoint(string, int)
Declaration
public static IPEndPoint MakeEndPoint(string hostStr, int port)
Parameters
Type |
Name |
Description |
string |
hostStr |
|
int |
port |
|
Returns
ResolveAddress(string)
Declaration
public static IPAddress ResolveAddress(string hostStr)
Parameters
Type |
Name |
Description |
string |
hostStr |
|
Returns
ResolveAddress(string, AddressFamily)
Declaration
public static IPAddress ResolveAddress(string hostStr, AddressFamily addressFamily)
Parameters
Returns