Photon Server API Documentation v5.0RC1

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]
 
bool IsConnectionSecure [get]
 

Detailed Description

Provides methods to communicate with other photon server applications.

Constructor & Destructor Documentation

◆ TcpClient() [1/4]

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

Initializes a new instance of the TcpClient class.

◆ TcpClient() [2/4]

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.

◆ TcpClient() [3/4]

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

Initializes a new instance of the TcpClient class.

Parameters
clientVersionThe client version.

◆ TcpClient() [4/4]

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

◆ OnAsyncSocketError()

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

Invokes the AsyncSocketError event.

Parameters
socketErrorThe socket error.

Implements Photon.SocketServer.ServerToServer.TcpClientBase.

◆ OnConnectCompleted()

override void Photon.SocketServer.ServerToServer.TcpClient.OnConnectCompleted ( )
inlineprotectedvirtual

◆ OnConnectError()

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.

◆ OnDisconnect()

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

Raises the Disconnected event.

Parameters
socketErrorThe socket error code.

Implements Photon.SocketServer.ServerToServer.TcpClientBase.

◆ OnEvent()

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.

◆ OnInitializeEcryptionCompleted()

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.

◆ OnOperationResponse()

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.

◆ OnPingResponse()

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

◆ AsyncSocketError

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

Invoked if an async operation completed with a SocketError.

◆ ConnectCompleted

EventHandler Photon.SocketServer.ServerToServer.TcpClient.ConnectCompleted

Invoked when the client succussfully connected to the remote host.

◆ ConnectError

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

Invoked when an error occures during a connection attempt.

◆ Disconnected

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

Invoked when the client has been diconnected.

◆ Event

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

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

◆ InitializeEncryptionCompleted

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

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

◆ OperationResponse

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

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

◆ PingResponse

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

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