Photon Server API
Public Member Functions | Protected Member Functions | Events | List of all members
Photon.SocketServer.ServerToServer.TcpClient Class Reference

Provides methods to communicate with other photon server applications. More...

Inheritance diagram for Photon.SocketServer.ServerToServer.TcpClient:
Photon.SocketServer.ServerToServer.TcpClientBase

Public Member Functions

 TcpClient ()
 Initializes a new instance of the TcpClient class. More...
 
 TcpClient (IRpcProtocol protocol)
 
 TcpClient (Version clientVersion)
 Initializes a new instance of the TcpClient class. More...
 
 TcpClient (IRpcProtocol protocol, Version clientVersion)
 Initializes a new instance of the TcpClient class. More...
 
- Public Member Functions inherited from Photon.SocketServer.ServerToServer.TcpClientBase
void Connect (IPEndPoint remoteEndPoint, string applicationId)
 Establishes a connection to the remote host. More...
 
void Connect (IPEndPoint remoteEndPoint, string applicationId, IPEndPoint localEndPoint)
 Establishes a connection to the remote host. More...
 
void Disconnect ()
 Closes the connection to the remote host. More...
 
SendResult InitializeEncryption ()
 Initializes the peer to receive and send encrypted operations. More...
 
SendResult SendOperationRequest (OperationRequest operationRequest, SendParameters sendParameters)
 Sends an operation request to the server. More...
 
SendResult SendPing ()
 Sends a ping request to the server. The ping request will be send with Environment.TickCount as the tme stamp. More...
 
SendResult SendPing (int timeStamp)
 Sends a ping request to the server. More...
 
void Dispose ()
 Releases all resources used this instance. More...
 
SendResult Send (byte[] data, SendParameters sendParameters)
 Sends bytes ... More...
 

Protected Member Functions

override void OnAsyncSocketError (SocketError socketError)
 Invokes the AsyncSocketError event. More...
 
override void OnConnectCompleted ()
 Raises the ConnectCompleted event. More...
 
override void OnConnectError (SocketError error)
 Raises the ConnectError event. More...
 
override void OnDisconnect (SocketError socketError)
 Raises the Disconnected event. More...
 
override void OnEvent (IEventData eventData, SendParameters sendParameters)
 Raises the Event event. More...
 
override void OnInitializeEcryptionCompleted (short resultCode, string debugMessage)
 Raises the InitializeEncryptionCompleted event. More...
 
override void OnOperationResponse (OperationResponse operationResponse, SendParameters sendParameters)
 Raises the OperationResponse event. More...
 
override void OnPingResponse (PingResponse pingResponse)
 Raises the PingResponse event. More...
 
- Protected Member Functions inherited from Photon.SocketServer.ServerToServer.TcpClientBase
 TcpClientBase ()
 Initializes a new instance of the TcpClientBase class. More...
 
 TcpClientBase (IRpcProtocol protocol)
 Initializes a new instance of the TcpClientBase class. More...
 
 TcpClientBase (Version clientVersion)
 Initializes a new instance of the TcpClientBase class. More...
 
 TcpClientBase (IRpcProtocol protocol, Version clientVersion)
 Initializes a new instance of the TcpClientBase class. More...
 
virtual void Dispose (bool disposing)
 Releases unmanaged and - optionally - managed resources More...
 
virtual void OnReceived (byte[] data, SendParameters sendParameters)
 Invoked when data was received. More...
 

Events

EventHandler< SocketErrorEventArgsAsyncSocketError
 Invoked if an async operation completed with a SocketError. More...
 
EventHandler ConnectCompleted
 Invoked when the client succussfully connected to the remote host. More...
 
EventHandler< SocketErrorEventArgsConnectError
 Invoked when an error occures during a connection attempt. More...
 
EventHandler< SocketErrorEventArgsDisconnected
 Invoked when the client has been diconnected. More...
 
EventHandler< EventDataEventArgsEvent
 Occurs when an event has been received from the remote host. More...
 
EventHandler< InitializeEncryptionEventArgsInitializeEncryptionCompleted
 Occurs when an inittlaize encryption response has been received from the remote host. More...
 
EventHandler< OperationResponseEventArgsOperationResponse
 Occurs when an operation response hav been received from the remote host. More...
 
EventHandler< PingResponseEventArgsPingResponse
 Occurs when a ping response has been received from the remote host. More...
 

Additional Inherited Members

- Properties inherited from Photon.SocketServer.ServerToServer.TcpClientBase
string ApplicationId [get]
 Gets the application id. More...
 
Version ClientVersion [get]
 Gets the client version. More...
 
bool Connected [get]
 Gets a value indicating whether this instance is connected to a remote host. More...
 
ICryptoProvider CryptoProvider [get, set]
 Gets or sets the CryptoProvider. More...
 
IPEndPoint LocalEndPoint [get]
 Gets the local endpoint. More...
 
IRpcProtocol Protocol [get]
 Gets the used rpc protocol. More...
 
IPEndPoint RemoteEndPoint [get]
 Gets the remote end point. More...
 
ConnectionState ConnectionState [get]
 

Detailed Description

Provides methods to communicate with other photon server applications.

Constructor & Destructor Documentation

Photon.SocketServer.ServerToServer.TcpClient.TcpClient ( )
inline

Initializes a new instance of the TcpClient class.

Photon.SocketServer.ServerToServer.TcpClient.TcpClient ( IRpcProtocol  protocol)
inline

Initializes a new instance of the TcpClient class.

Parameters
protocolThe IRpcProtocol to use for operation and event serialization.
Photon.SocketServer.ServerToServer.TcpClient.TcpClient ( Version  clientVersion)
inline

Initializes a new instance of the TcpClient class.

Parameters
clientVersionThe client version.
Photon.SocketServer.ServerToServer.TcpClient.TcpClient ( IRpcProtocol  protocol,
Version  clientVersion 
)
inline

Initializes a new instance of the TcpClient class.

Parameters
protocolThe IRpcProtocol to use for operation and event serialization.
clientVersionThe client version.

Member Function Documentation

override void Photon.SocketServer.ServerToServer.TcpClient.OnAsyncSocketError ( SocketError  socketError)
inlineprotectedvirtual

Invokes the AsyncSocketError event.

Parameters
socketErrorThe socket error.

Implements Photon.SocketServer.ServerToServer.TcpClientBase.

override void Photon.SocketServer.ServerToServer.TcpClient.OnConnectCompleted ( )
inlineprotectedvirtual
override void Photon.SocketServer.ServerToServer.TcpClient.OnConnectError ( SocketError  error)
inlineprotectedvirtual

Raises the ConnectError event.

Parameters
errorThe socket error which occured during teh connection attempt.

Implements Photon.SocketServer.ServerToServer.TcpClientBase.

override void Photon.SocketServer.ServerToServer.TcpClient.OnDisconnect ( SocketError  socketError)
inlineprotectedvirtual

Raises the Disconnected event.

Parameters
socketErrorThe socket error code.

Implements Photon.SocketServer.ServerToServer.TcpClientBase.

override void Photon.SocketServer.ServerToServer.TcpClient.OnEvent ( IEventData  eventData,
SendParameters  sendParameters 
)
inlineprotectedvirtual

Raises the Event event.

Parameters
eventDataThe event data.
sendParametersThe send parameters the response was received with.

Implements Photon.SocketServer.ServerToServer.TcpClientBase.

override void Photon.SocketServer.ServerToServer.TcpClient.OnInitializeEcryptionCompleted ( short  resultCode,
string  debugMessage 
)
inlineprotectedvirtual

Raises the InitializeEncryptionCompleted event.

Parameters
resultCodeThe result code received from the remote host.
debugMessageThe debug message received from the remote host.

Reimplemented from Photon.SocketServer.ServerToServer.TcpClientBase.

override void Photon.SocketServer.ServerToServer.TcpClient.OnOperationResponse ( OperationResponse  operationResponse,
SendParameters  sendParameters 
)
inlineprotectedvirtual

Raises the OperationResponse event.

Parameters
operationResponseThe operation response.
sendParametersThe send parameters the response was received with.

Implements Photon.SocketServer.ServerToServer.TcpClientBase.

override void Photon.SocketServer.ServerToServer.TcpClient.OnPingResponse ( PingResponse  pingResponse)
inlineprotectedvirtual

Raises the PingResponse event.

Parameters
pingResponseThe ping response.

Implements Photon.SocketServer.ServerToServer.TcpClientBase.

Event Documentation

EventHandler<SocketErrorEventArgs> Photon.SocketServer.ServerToServer.TcpClient.AsyncSocketError

Invoked if an async operation completed with a SocketError.

EventHandler Photon.SocketServer.ServerToServer.TcpClient.ConnectCompleted

Invoked when the client succussfully connected to the remote host.

EventHandler<SocketErrorEventArgs> Photon.SocketServer.ServerToServer.TcpClient.ConnectError

Invoked when an error occures during a connection attempt.

EventHandler<SocketErrorEventArgs> Photon.SocketServer.ServerToServer.TcpClient.Disconnected

Invoked when the client has been diconnected.

EventHandler<EventDataEventArgs> Photon.SocketServer.ServerToServer.TcpClient.Event

Occurs when an event has been received from the remote host.

EventHandler<InitializeEncryptionEventArgs> Photon.SocketServer.ServerToServer.TcpClient.InitializeEncryptionCompleted

Occurs when an inittlaize encryption response has been received from the remote host.

EventHandler<OperationResponseEventArgs> Photon.SocketServer.ServerToServer.TcpClient.OperationResponse

Occurs when an operation response hav been received from the remote host.

EventHandler<PingResponseEventArgs> Photon.SocketServer.ServerToServer.TcpClient.PingResponse

Occurs when a ping response has been received from the remote host.