Skip to content

Class Lidgren::Network::NetUtility

ClassList > Lidgren > Network > NetUtility

Utility methods.

Public Static Properties

Type Name
property double Now

Public Functions

Type Name
delegate void ResolveAddressCallback (NetAddress adr)
Resolve address callback.
delegate void ResolveEndPointCallback (NetEndPoint endPoint)
Resolve endpoint callback.

Public Static Functions

Type Name
int BitsToHoldUInt (uint value)
Returns how many bits are necessary to hold a certain number.
int BitsToHoldUInt64 (ulong value)
Returns how many bits are necessary to hold a certain number.
int BytesToHoldBits (int numBits)
Returns how many bytes are required to hold a certain number of bits.
byte[] ComputeSHAHash (byte[] bytes)
byte[] ComputeSHAHash (byte[] bytes, int offset, int count)
IPAddress CreateAddressFromBytes (byte[] bytes)
IPAddress GetBroadcastAddress ()
IPAddress GetCachedBroadcastAddress ()
byte[] GetMacAddressBytes ()
If available, returns the bytes of the physical (MAC) address for the first usable network interface.
IPAddress GetMyAddress (out IPAddress mask)
Gets my local IPv4 address (not necessarily external) and subnet mask.
ulong GetPlatformSeed (int seedInc)
int GetWindowSize (NetDeliveryMethod method)
Gets the window size used internally in the library for a certain delivery method.
bool IsLocal (NetEndPoint endPoint)
Returns true if the endpoint supplied is on the same subnet as this host.
bool IsLocal (NetAddress remote)
Returns true if the IPAddress supplied is on the same subnet as this host.
string MakeCommaDelimitedList< T > (IList< T > list)
Creates a comma delimited string from a lite of items.
NetEndPoint Resolve (string ipOrHost, int port)
Get IPv4 endpoint from notation (xxx.xxx.xxx.xxx) or hostname and port number.
NetAddress Resolve (string ipOrHost)
Get IPv4 address from notation (xxx.xxx.xxx.xxx) or hostname.
void ResolveAsync (string ipOrHost, int port, ResolveEndPointCallback callback)
Get IPv4 endpoint from notation (xxx.xxx.xxx.xxx) or hostname and port number (asynchronous version)
void ResolveAsync (string ipOrHost, ResolveAddressCallback callback)
Get IPv4 address from notation (xxx.xxx.xxx.xxx) or hostname (asynchronous version)
void Sleep (int milliseconds)
byte[] ToByteArray (String hexString)
Convert a hexadecimal string to a byte array.
string ToHexString (long data)
Create a hex string from an Int64 value.
string ToHexString (byte[] data)
Create a hex string from an array of bytes.
string ToHexString (byte[] data, int offset, int length)
Create a hex string from an array of bytes.
string ToHumanReadable (long bytes)
Converts a number of bytes to a shorter, more readable string representation.

Public Static Properties Documentation

property Now

double Lidgren.Network.NetUtility.Now;

Public Functions Documentation

function ResolveAddressCallback

delegate void Lidgren::Network::NetUtility::ResolveAddressCallback (
    NetAddress adr
) 

function ResolveEndPointCallback

delegate void Lidgren::Network::NetUtility::ResolveEndPointCallback (
    NetEndPoint endPoint
) 

Public Static Functions Documentation

function BitsToHoldUInt

static inline int Lidgren::Network::NetUtility::BitsToHoldUInt (
    uint value
) 

function BitsToHoldUInt64

static inline int Lidgren::Network::NetUtility::BitsToHoldUInt64 (
    ulong value
) 

function BytesToHoldBits

static inline int Lidgren::Network::NetUtility::BytesToHoldBits (
    int numBits
) 

function ComputeSHAHash [1/2]

static inline byte[] Lidgren::Network::NetUtility::ComputeSHAHash (
    byte[] bytes
) 

function ComputeSHAHash [2/2]

static inline byte[] Lidgren::Network::NetUtility::ComputeSHAHash (
    byte[] bytes,
    int offset,
    int count
) 

function CreateAddressFromBytes

static inline IPAddress Lidgren::Network::NetUtility::CreateAddressFromBytes (
    byte[] bytes
) 

function GetBroadcastAddress

static inline IPAddress Lidgren::Network::NetUtility::GetBroadcastAddress () 

function GetCachedBroadcastAddress

static inline IPAddress Lidgren::Network::NetUtility::GetCachedBroadcastAddress () 

function GetMacAddressBytes

static inline byte[] Lidgren::Network::NetUtility::GetMacAddressBytes () 

function GetMyAddress

static inline IPAddress Lidgren::Network::NetUtility::GetMyAddress (
    out IPAddress mask
) 

function GetPlatformSeed

static inline ulong Lidgren::Network::NetUtility::GetPlatformSeed (
    int seedInc
) 

function GetWindowSize

static inline int Lidgren::Network::NetUtility::GetWindowSize (
    NetDeliveryMethod method
) 

function IsLocal [1/2]

static inline bool Lidgren::Network::NetUtility::IsLocal (
    NetEndPoint endPoint
) 

function IsLocal [2/2]

static inline bool Lidgren::Network::NetUtility::IsLocal (
    NetAddress remote
) 

function MakeCommaDelimitedList< T >

static inline string Lidgren::Network::NetUtility::MakeCommaDelimitedList< T > (
    IList< T > list
) 

function Resolve [1/2]

static inline NetEndPoint Lidgren::Network::NetUtility::Resolve (
    string ipOrHost,
    int port
) 

function Resolve [2/2]

static inline NetAddress Lidgren::Network::NetUtility::Resolve (
    string ipOrHost
) 

function ResolveAsync [1/2]

static inline void Lidgren::Network::NetUtility::ResolveAsync (
    string ipOrHost,
    int port,
    ResolveEndPointCallback callback
) 

function ResolveAsync [2/2]

static inline void Lidgren::Network::NetUtility::ResolveAsync (
    string ipOrHost,
    ResolveAddressCallback callback
) 

function Sleep

static inline void Lidgren::Network::NetUtility::Sleep (
    int milliseconds
) 

function ToByteArray

static inline byte[] Lidgren::Network::NetUtility::ToByteArray (
    String hexString
) 

function ToHexString [1/3]

static inline string Lidgren::Network::NetUtility::ToHexString (
    long data
) 

function ToHexString [2/3]

static inline string Lidgren::Network::NetUtility::ToHexString (
    byte[] data
) 

function ToHexString [3/3]

static inline string Lidgren::Network::NetUtility::ToHexString (
    byte[] data,
    int offset,
    int length
) 

function ToHumanReadable

static inline string Lidgren::Network::NetUtility::ToHumanReadable (
    long bytes
) 

The documentation for this class was generated from the following file api/unity-plugin/Scripts/Networking/Lidgren.Network/NetUtility.cs