C# Класс 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.
Наследование: ServiceMessage
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
extraFlags string
queryTimeout DateTime?

Открытые методы

Метод Описание
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

Защищенные методы

Метод Описание
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

Описание методов

BuildResponse() защищенный абстрактный Метод

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
Результат ResponseData

MergeResponseData() защищенный статический Метод

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
Результат byte[]

QueryNetwork() защищенный Метод

Initiates a network query for a session
protected QueryNetwork ( ) : bool
Результат bool

QueryNetwork() защищенный Метод

Initiates a network query for a session
protected QueryNetwork ( System TimeoutHandler ) : bool
TimeoutHandler System The Action that is called when the query times out
Результат bool

Reply() публичный Метод

Sends a reply to the source of this request
public Reply ( ResponseData Response ) : void
Response ResponseData The response data
Результат void

ServiceRequest() публичный Метод

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
Результат System

Validate() защищенный Метод

Validates a ServiceRequest message
protected Validate ( ) : bool
Результат bool

Описание свойств

extraFlags защищенное свойство

The request ExtraFlags value
protected string extraFlags
Результат string

queryTimeout защищенное свойство

The time out datestamp for a network query
protected DateTime? queryTimeout
Результат DateTime?