C# Class MsgPack.Rpc.Client.RpcClient

Entry point of MessagePack-RPC client.
Inheritance: IDisposable
Afficher le fichier Open project: yfakariya/msgpack-rpc-cli Class Usage Examples

Private Properties

Свойство Type Description
EnsureConnected void
NextId int
OnTranportShutdownComplete void
VerifyIsNotDisposed void

Méthodes publiques

Méthode Description
BeginCall ( string methodName, object arguments, AsyncCallback asyncCallback, object asyncState ) : IAsyncResult

Calls specified remote method with specified argument asynchronously.

BeginNotify ( string methodName, object arguments, AsyncCallback asyncCallback, object asyncState ) : IAsyncResult

Sends specified remote method with specified argument as notification message asynchronously.

Call ( string methodName ) : MessagePackObject

Calls specified remote method with specified argument and returns its result synchronously.

CallAsync ( string methodName, object arguments, object asyncState ) : Task

Calls specified remote method with specified argument asynchronously.

In .NET Framework 4.0, Silverlight 5, or Windows Phone 7.5, the exception will be thrown as AggregateException in continuation Task. But this is because of runtime limitation, so this behavior will change in the future. You can BeginCall and EndCall to get appropriate exception directly.

Dispose ( ) : void

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

EndCall ( IAsyncResult asyncResult ) : MessagePackObject

Finishes asynchronous method invocation and returns its result.

You must call this method to clean up internal bookkeeping information and handles communication error even if the remote method returns void.

EndNotify ( IAsyncResult asyncResult ) : void

Finishes asynchronous method invocation.

You must call this method to clean up internal bookkeeping information and handles communication error.

Notify ( string methodName ) : void

Sends specified remote method with specified argument as notification message synchronously.

NotifyAsync ( string methodName, object arguments, object asyncState ) : Task

Sends specified remote method with specified argument as notification message asynchronously.

In .NET Framework 4.0, Silverlight 5, or Windows Phone 7.5, the exception will be thrown as AggregateException in continuation Task. But this is because of runtime limitation, so this behavior will change in the future. You can BeginNotify and EndNotify to get appropriate exception directly.

RpcClient ( EndPoint targetEndPoint ) : System

Initializes a new instance of the RpcClient class.

RpcClient ( EndPoint targetEndPoint, MsgPack.Rpc.Client.RpcClientConfiguration configuration ) : System

Initializes a new instance of the RpcClient class.

RpcClient ( EndPoint targetEndPoint, MsgPack.Rpc.Client.RpcClientConfiguration configuration, MsgPack.Serialization.SerializationContext serializationContext ) : System

Initializes a new instance of the RpcClient class.

RpcClient ( EndPoint targetEndPoint, MsgPack.Serialization.SerializationContext serializationContext ) : System

Initializes a new instance of the RpcClient class.

Shutdown ( ) : void

Initiates shutdown of current connection and wait to complete it.

ShutdownAsync ( ) : Task

Initiates shutdown of current connection.

Private Methods

Méthode Description
EnsureConnected ( ) : void
NextId ( ) : int
OnTranportShutdownComplete ( object sender, EventArgs e ) : void
VerifyIsNotDisposed ( ) : void

Method Details

BeginCall() public méthode

Calls specified remote method with specified argument asynchronously.
/// is null. /// /// is not valid. ///
public BeginCall ( string methodName, object arguments, AsyncCallback asyncCallback, object asyncState ) : IAsyncResult
methodName string /// The name of target method. ///
arguments object /// Argument to be passed to the server. /// All values must be able to be serialized with MessagePack serializer. ///
asyncCallback AsyncCallback /// The callback method invoked when the notification is sent or the reponse is received. /// This value can be null. /// Usually this callback get the result of invocation via . ///
asyncState object /// User supplied state object which can be gotten via in the callback. /// This value can be null. ///
Résultat IAsyncResult

BeginNotify() public méthode

Sends specified remote method with specified argument as notification message asynchronously.
/// is null. /// /// is not valid. ///
public BeginNotify ( string methodName, object arguments, AsyncCallback asyncCallback, object asyncState ) : IAsyncResult
methodName string /// The name of target method. ///
arguments object /// Argument to be passed to the server. /// All values must be able to be serialized with MessagePack serializer. ///
asyncCallback AsyncCallback /// The callback method invoked when the notification is sent or the reponse is received. /// This value can be null. /// Usually this callback get the result of invocation via . ///
asyncState object /// User supplied state object which can be gotten via in the callback. /// This value can be null. ///
Résultat IAsyncResult

Call() public méthode

Calls specified remote method with specified argument and returns its result synchronously.
/// is null. /// /// is not valid. /// /// Failed to execute specified remote method. ///
public Call ( string methodName ) : MessagePackObject
methodName string /// The name of target method. ///
Résultat MessagePackObject

CallAsync() public méthode

Calls specified remote method with specified argument asynchronously.
In .NET Framework 4.0, Silverlight 5, or Windows Phone 7.5, the exception will be thrown as AggregateException in continuation Task. But this is because of runtime limitation, so this behavior will change in the future. You can BeginCall and EndCall to get appropriate exception directly.
/// is null. /// /// is not valid. ///
public CallAsync ( string methodName, object arguments, object asyncState ) : Task
methodName string /// The name of target method. ///
arguments object /// Argument to be passed to the server. /// All values must be able to be serialized with MessagePack serializer. ///
asyncState object /// User supplied state object to be set as . ///
Résultat Task

Dispose() public méthode

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public Dispose ( ) : void
Résultat void

EndCall() public méthode

Finishes asynchronous method invocation and returns its result.
You must call this method to clean up internal bookkeeping information and handles communication error even if the remote method returns void.
/// is null. /// /// is not valid type. /// /// is returned from other instance, /// or its state is not valid. /// /// Failed to execute specified remote method. ///
public EndCall ( IAsyncResult asyncResult ) : MessagePackObject
asyncResult IAsyncResult /// returned from . ///
Résultat MessagePackObject

EndNotify() public méthode

Finishes asynchronous method invocation.
You must call this method to clean up internal bookkeeping information and handles communication error.
/// is null. /// /// is not valid type. /// /// is returned from other instance, /// or its state is not valid. /// /// Failed to execute specified remote method. ///
public EndNotify ( IAsyncResult asyncResult ) : void
asyncResult IAsyncResult /// returned from . ///
Résultat void

Notify() public méthode

Sends specified remote method with specified argument as notification message synchronously.
/// is null. /// /// is not valid. /// /// Failed to send notification message. ///
public Notify ( string methodName ) : void
methodName string /// The name of target method. ///
Résultat void

NotifyAsync() public méthode

Sends specified remote method with specified argument as notification message asynchronously.
In .NET Framework 4.0, Silverlight 5, or Windows Phone 7.5, the exception will be thrown as AggregateException in continuation Task. But this is because of runtime limitation, so this behavior will change in the future. You can BeginNotify and EndNotify to get appropriate exception directly.
/// is null. /// /// is not valid. ///
public NotifyAsync ( string methodName, object arguments, object asyncState ) : Task
methodName string /// The name of target method. ///
arguments object /// Argument to be passed to the server. /// All values must be able to be serialized with MessagePack serializer. ///
asyncState object /// User supplied state object to be set as . ///
Résultat Task

RpcClient() public méthode

Initializes a new instance of the RpcClient class.
/// is null. ///
public RpcClient ( EndPoint targetEndPoint ) : System
targetEndPoint System.Net.EndPoint /// for the target. ///
Résultat System

RpcClient() public méthode

Initializes a new instance of the RpcClient class.
/// is null. ///
public RpcClient ( EndPoint targetEndPoint, MsgPack.Rpc.Client.RpcClientConfiguration configuration ) : System
targetEndPoint System.Net.EndPoint /// for the target. ///
configuration MsgPack.Rpc.Client.RpcClientConfiguration /// A which contains protocol information etc. ///
Résultat System

RpcClient() public méthode

Initializes a new instance of the RpcClient class.
/// is null. ///
public RpcClient ( EndPoint targetEndPoint, MsgPack.Rpc.Client.RpcClientConfiguration configuration, MsgPack.Serialization.SerializationContext serializationContext ) : System
targetEndPoint System.Net.EndPoint /// for the target. ///
configuration MsgPack.Rpc.Client.RpcClientConfiguration /// A which contains protocol information etc. ///
serializationContext MsgPack.Serialization.SerializationContext /// A to hold serializers. ///
Résultat System

RpcClient() public méthode

Initializes a new instance of the RpcClient class.
/// is null. ///
public RpcClient ( EndPoint targetEndPoint, MsgPack.Serialization.SerializationContext serializationContext ) : System
targetEndPoint System.Net.EndPoint /// for the target. ///
serializationContext MsgPack.Serialization.SerializationContext /// A to hold serializers. ///
Résultat System

Shutdown() public méthode

Initiates shutdown of current connection and wait to complete it.
public Shutdown ( ) : void
Résultat void

ShutdownAsync() public méthode

Initiates shutdown of current connection.
public ShutdownAsync ( ) : Task
Résultat Task