C# Class FiftyOne.Foundation.Mobile.Redirection.RequestRecord

Class used to convert a HttpRequest into a single long value that is almost unique for the requesting device. Two devices that share the same external IP address and HTTP headers will calculate to the same long value so it may not always be unique. The number of handsets that fall into this category should be sufficiently small enough for it not to present a practical problem. The date and time the request was received is also recorded to enable out of date records to be removed from the list.
Inheritance: IComparable
Afficher le fichier Open project: 51Degrees/dotNET-Device-Detection Class Usage Examples

Méthodes publiques

Méthode Description
CompareTo ( object obj ) : int

Compares one request to another to determine if they are the same.

Méthodes protégées

Méthode Description
Read ( BinaryReader reader ) : void
RequestRecord ( ) : System

Creates a new empty instance of RequestRecord class.

RequestRecord ( BinaryReader reader ) : System
RequestRecord ( HttpRequest request ) : System

If the IP address is IPv4 (4 bytes) then use the ip address as the high order bytes of the value and the hashcode as the low order bytes. If the IP address is IPv6 (8 bytes) then covert the bytes to a 64 bit integer. If anything else which we can't imagine use a hashcode of the string value.

RequestRecord ( RequestRecord recordToCopy ) : System

Constructs a new instance of RequestRecord class. Copies the values of the RequestRecord provided to the new instance.

Write ( Stream stream ) : void

Private Methods

Méthode Description
SetHashCode ( byte buffer, HttpRequest request ) : void

Adds the hashcode of the relevent header fields as the low order bytes of the array.

Method Details

CompareTo() public méthode

Compares one request to another to determine if they are the same.
public CompareTo ( object obj ) : int
obj object The object being compared.
Résultat int

Read() protected méthode

protected Read ( BinaryReader reader ) : void
reader System.IO.BinaryReader
Résultat void

RequestRecord() protected méthode

Creates a new empty instance of RequestRecord class.
protected RequestRecord ( ) : System
Résultat System

RequestRecord() protected méthode

protected RequestRecord ( BinaryReader reader ) : System
reader System.IO.BinaryReader
Résultat System

RequestRecord() protected méthode

If the IP address is IPv4 (4 bytes) then use the ip address as the high order bytes of the value and the hashcode as the low order bytes. If the IP address is IPv6 (8 bytes) then covert the bytes to a 64 bit integer. If anything else which we can't imagine use a hashcode of the string value.
protected RequestRecord ( HttpRequest request ) : System
request HttpRequest
Résultat System

RequestRecord() protected méthode

Constructs a new instance of RequestRecord class. Copies the values of the RequestRecord provided to the new instance.
protected RequestRecord ( RequestRecord recordToCopy ) : System
recordToCopy RequestRecord
Résultat System

Write() protected méthode

protected Write ( Stream stream ) : void
stream Stream
Résultat void