C# Class P2PStateServer.ServiceRequest

Represents a ServiceRequest message
The ServiceRequest class represents a request message from a peer to another or from a client to a state server. Request messages should be derived from the ServiceRequest class.
Inheritance: ServiceMessage
Afficher le fichier Open project: tenor/p2pStateServer

Protected Properties

Свойство Type Description
extraFlags string
queryTimeout DateTime?

Méthodes publiques

Méthode Description
Reply ( ResponseData Response ) : void

Sends a reply to the source of this request

ServiceRequest ( HTTPPartialData Data, StateServer Service ) : System

Initializes a new instance of the ServiceRequest class

Méthodes protégées

Méthode Description
BuildResponse ( Type ResponseType, string ResponseMessage, ISessionResponseInfo ResponseInfo, byte Content ) : ResponseData

When overriden in a derived class, Generates an appropriate ResponseData object for this message, filled with supplied data

MergeResponseData ( StringBuilder Headers, byte Content, bool AppendContent, bool EncryptContent, SHA256_AESAuthenticator Authenticator, byte SessionKey ) : byte[]

Generates a raw response message data

QueryNetwork ( ) : bool

Initiates a network query for a session

QueryNetwork ( System TimeoutHandler ) : bool

Initiates a network query for a session

Validate ( ) : bool

Validates a ServiceRequest message

Method Details

BuildResponse() protected abstract méthode

When overriden in a derived class, Generates an appropriate ResponseData object for this message, filled with supplied data
protected abstract BuildResponse ( Type ResponseType, string ResponseMessage, ISessionResponseInfo ResponseInfo, byte Content ) : ResponseData
ResponseType System.Type The Type of the Response message
ResponseMessage string The HTTP response reason phrase
ResponseInfo ISessionResponseInfo The session response information
Content byte The response data
Résultat ResponseData

MergeResponseData() protected static méthode

Generates a raw response message data
protected static MergeResponseData ( StringBuilder Headers, byte Content, bool AppendContent, bool EncryptContent, SHA256_AESAuthenticator Authenticator, byte SessionKey ) : byte[]
Headers StringBuilder The HTTP Headers (includes first line)
Content byte The Content (message body)
AppendContent bool Specifies whether the content is to be included in the generated message
EncryptContent bool Specifies whether the content is to be encrypted
Authenticator SHA256_AESAuthenticator The Authenticator object
SessionKey byte The session encryption key
Résultat byte[]

QueryNetwork() protected méthode

Initiates a network query for a session
protected QueryNetwork ( ) : bool
Résultat bool

QueryNetwork() protected méthode

Initiates a network query for a session
protected QueryNetwork ( System TimeoutHandler ) : bool
TimeoutHandler System The Action that is called when the query times out
Résultat bool

Reply() public méthode

Sends a reply to the source of this request
public Reply ( ResponseData Response ) : void
Response ResponseData The response data
Résultat void

ServiceRequest() public méthode

Initializes a new instance of the ServiceRequest class
public ServiceRequest ( HTTPPartialData Data, StateServer Service ) : System
Data HTTPPartialData The HTTPPartialData class to load this instance from
Service StateServer State server instance
Résultat System

Validate() protected méthode

Validates a ServiceRequest message
protected Validate ( ) : bool
Résultat bool

Property Details

extraFlags protected_oe property

The request ExtraFlags value
protected string extraFlags
Résultat string

queryTimeout protected_oe property

The time out datestamp for a network query
protected DateTime? queryTimeout
Résultat DateTime?