Photon Server API
Public Member Functions | Protected Member Functions | Properties | List of all members
Photon.SocketServer.Web.HttpClientBase Class Referenceabstract

Photon http application client implementation. More...

Public Member Functions

bool Connect (string applicationId)
 Connects this instance to a photon http application. More...
 
void Disconnect ()
 Disconnects the http client. More...
 
SendResult InitializeEncryption ()
 Initializes the peer to receive and send encrypted operations. More...
 
SendResult SendPing ()
 Send a ping request to a photon http application. More...
 
void SendOperationRequest (OperationRequest request)
 Sends an operation request to a photon http application. More...
 
SendResult SendOperationRequest (OperationRequest request, bool encrypt)
 Sends an operation request to a photn http application. More...
 

Protected Member Functions

 HttpClientBase (string url, int timeout, int pingInterval)
 Initializes a new instance of the HttpClientBase class. More...
 
 HttpClientBase (string url, int timeout, int pingInterval, string connectionId)
 Initializes a new instance of the HttpClientBase class. More...
 
abstract void OnDisconnect (DisconnectReason reasonCode, string reasonDetail)
 The connection was closed. More...
 
virtual void OnInitializeEcryptionCompleted (short resultCode, string debugMessage)
 Invoked if an initialize encryption request was completed. More...
 
virtual void OnUnexpectedDataReceived (byte[] data, string debugMessage)
 This method is called if incoming data has an unexpected format. Per default this method disconnects the client. Override to change this behavior. More...
 

Properties

string Address [get]
 Gets the address. More...
 
ICryptoProvider CryptoProvider [get, set]
 Gets or sets the CryptoProvider. More...
 
string ConnectionId [get]
 Gets the connection id. More...
 
bool IsConnected [get]
 Gets a value indicating if the client is connected. More...
 

Detailed Description

Photon http application client implementation.

The

Constructor & Destructor Documentation

Photon.SocketServer.Web.HttpClientBase.HttpClientBase ( string  url,
int  timeout,
int  pingInterval 
)
inlineprotected

Initializes a new instance of the HttpClientBase class.

Parameters
urlThe url of the photon http application.
timeoutThe length of time, in milliseconds, before http request are timing out.
pingIntervalThe time in milliseconds when an automatic ping will be sent after the last operation request to fetch new messages from the server.
Photon.SocketServer.Web.HttpClientBase.HttpClientBase ( string  url,
int  timeout,
int  pingInterval,
string  connectionId 
)
inlineprotected

Initializes a new instance of the HttpClientBase class.

Parameters
urlThe url of the photon http application.
timeoutThe length of time, in milliseconds, before the operation request are timing out.
pingIntervalThe time in milliseconds when an automatic ping will be sent after the last operation request to fetch new messages from the server.
connectionIdThe connection id.

Member Function Documentation

bool Photon.SocketServer.Web.HttpClientBase.Connect ( string  applicationId)
inline

Connects this instance to a photon http application.

Returns
True if successfully connected to the photon application; otherwise false.
void Photon.SocketServer.Web.HttpClientBase.Disconnect ( )
inline

Disconnects the http client.

SendResult Photon.SocketServer.Web.HttpClientBase.InitializeEncryption ( )
inline

Initializes the peer to receive and send encrypted operations.

abstract void Photon.SocketServer.Web.HttpClientBase.OnDisconnect ( DisconnectReason  reasonCode,
string  reasonDetail 
)
protectedpure virtual

The connection was closed.

virtual void Photon.SocketServer.Web.HttpClientBase.OnInitializeEcryptionCompleted ( short  resultCode,
string  debugMessage 
)
inlineprotectedvirtual

Invoked if an initialize encryption request was completed.

Parameters
resultCodeThe result code.
debugMessageThe debuf message.
virtual void Photon.SocketServer.Web.HttpClientBase.OnUnexpectedDataReceived ( byte[]  data,
string  debugMessage 
)
inlineprotectedvirtual

This method is called if incoming data has an unexpected format. Per default this method disconnects the client. Override to change this behavior.

Parameters
dataThe received data.
debugMessageA debug message that specifies why the data was unexpected.
void Photon.SocketServer.Web.HttpClientBase.SendOperationRequest ( OperationRequest  request)
inline

Sends an operation request to a photon http application.

Parameters
requestThe operation request.
Returns
The operation response received from the photon application or null if no resonse was sent.
SendResult Photon.SocketServer.Web.HttpClientBase.SendOperationRequest ( OperationRequest  request,
bool  encrypt 
)
inline

Sends an operation request to a photn http application.

Parameters
requestThe operation request.
encryptSpecifies if the request should be encrypted.
Returns
The operation response received from the photon application or null if no resonse was sent.
SendResult Photon.SocketServer.Web.HttpClientBase.SendPing ( )
inline

Send a ping request to a photon http application.

Returns

Property Documentation

string Photon.SocketServer.Web.HttpClientBase.Address
get

Gets the address.

string Photon.SocketServer.Web.HttpClientBase.ConnectionId
get

Gets the connection id.

ICryptoProvider Photon.SocketServer.Web.HttpClientBase.CryptoProvider
getset

Gets or sets the CryptoProvider.

bool Photon.SocketServer.Web.HttpClientBase.IsConnected
get

Gets a value indicating if the client is connected.