C# 클래스 Lidgren.Network.Authentication.NetUtility

Utility methods
파일 보기 프로젝트 열기: SleeplessByte/lidgren-srp6a 1 사용 예제들

공개 메소드들

메소드 설명
ArraysEqual ( Byte ba1, Byte ba2 ) : System.Boolean

Checks if Arrays are Equal

BitsToHoldUInt ( uint value ) : int

Returns how many bits are necessary to hold a certain number

BytesToHoldBits ( int numBits ) : int

Returns how many bytes are required to hold a certain number of bits

GetMacAddress ( ) : System.Net.NetworkInformation.PhysicalAddress

Returns the physical (MAC) address for the first usable network interface

GetMyAddress ( IPAddress &mask ) : IPAddress

Gets my local IP address (not necessarily external) and subnet mask

IsLocal ( IPAddress remote ) : bool

Returns true if the IPAddress supplied is on the same subnet as this host

IsLocal ( IPEndPoint endpoint ) : bool

Returns true if the IPEndPoint supplied is on the same subnet as this host

JoinArrays ( Byte b1, Byte b2 ) : Byte[]

Joins two arrays using Buffer.Blockcopy

JoinArrays ( System byteArrays ) : Byte[]

Joins all arrays in arraylist using MemoryStream

Resolve ( string ipOrHost ) : IPAddress

Get IPv4 address from notation (xxx.xxx.xxx.xxx) or hostname

Resolve ( string ipOrHost, int port ) : IPEndPoint

Get IPv4 endpoint from notation (xxx.xxx.xxx.xxx) or hostname and port number

ToByteArray ( String hexString ) : byte[]

Convert a hexadecimal string to a byte array

ToHexString ( byte data ) : string

Create a hex string from an array of bytes

ToHexString ( long data ) : string

Create a hex string from an Int64 value

ToHumanReadable ( long bytes ) : string

Converts a number of bytes to a shorter, more readable string representation

비공개 메소드들

메소드 설명
CompareElements ( byte one, byte two ) : bool
GetNetworkInterface ( ) : NetworkInterface
SortMembersList ( System list ) : void
SwapByteOrder ( UInt32 value ) : UInt32
SwapByteOrder ( System.UInt64 value ) : System.UInt64

메소드 상세

ArraysEqual() 공개 정적인 메소드

Checks if Arrays are Equal
public static ArraysEqual ( Byte ba1, Byte ba2 ) : System.Boolean
ba1 Byte
ba2 Byte
리턴 System.Boolean

BitsToHoldUInt() 공개 정적인 메소드

Returns how many bits are necessary to hold a certain number
public static BitsToHoldUInt ( uint value ) : int
value uint
리턴 int

BytesToHoldBits() 공개 정적인 메소드

Returns how many bytes are required to hold a certain number of bits
public static BytesToHoldBits ( int numBits ) : int
numBits int
리턴 int

GetMacAddress() 공개 정적인 메소드

Returns the physical (MAC) address for the first usable network interface
public static GetMacAddress ( ) : System.Net.NetworkInformation.PhysicalAddress
리턴 System.Net.NetworkInformation.PhysicalAddress

GetMyAddress() 공개 정적인 메소드

Gets my local IP address (not necessarily external) and subnet mask
public static GetMyAddress ( IPAddress &mask ) : IPAddress
mask System.Net.IPAddress
리턴 System.Net.IPAddress

IsLocal() 공개 정적인 메소드

Returns true if the IPAddress supplied is on the same subnet as this host
public static IsLocal ( IPAddress remote ) : bool
remote System.Net.IPAddress
리턴 bool

IsLocal() 공개 정적인 메소드

Returns true if the IPEndPoint supplied is on the same subnet as this host
public static IsLocal ( IPEndPoint endpoint ) : bool
endpoint System.Net.IPEndPoint
리턴 bool

JoinArrays() 공개 정적인 메소드

Joins two arrays using Buffer.Blockcopy
public static JoinArrays ( Byte b1, Byte b2 ) : Byte[]
b1 Byte
b2 Byte
리턴 Byte[]

JoinArrays() 공개 정적인 메소드

Joins all arrays in arraylist using MemoryStream
public static JoinArrays ( System byteArrays ) : Byte[]
byteArrays System list of arrays to join
리턴 Byte[]

Resolve() 공개 정적인 메소드

Get IPv4 address from notation (xxx.xxx.xxx.xxx) or hostname
public static Resolve ( string ipOrHost ) : IPAddress
ipOrHost string
리턴 System.Net.IPAddress

Resolve() 공개 정적인 메소드

Get IPv4 endpoint from notation (xxx.xxx.xxx.xxx) or hostname and port number
public static Resolve ( string ipOrHost, int port ) : IPEndPoint
ipOrHost string
port int
리턴 System.Net.IPEndPoint

ToByteArray() 공개 정적인 메소드

Convert a hexadecimal string to a byte array
public static ToByteArray ( String hexString ) : byte[]
hexString String
리턴 byte[]

ToHexString() 공개 정적인 메소드

Create a hex string from an array of bytes
public static ToHexString ( byte data ) : string
data byte
리턴 string

ToHexString() 공개 정적인 메소드

Create a hex string from an Int64 value
public static ToHexString ( long data ) : string
data long
리턴 string

ToHumanReadable() 공개 정적인 메소드

Converts a number of bytes to a shorter, more readable string representation
public static ToHumanReadable ( long bytes ) : string
bytes long
리턴 string