C# Class MsgPack.Rpc.Client.RpcClient

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

Private Properties

Property Type Description
EnsureConnected void
NextId int
OnTranportShutdownComplete void
VerifyIsNotDisposed void

Public Methods

Method 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

Method Description
EnsureConnected ( ) : void
NextId ( ) : int
OnTranportShutdownComplete ( object sender, EventArgs e ) : void
VerifyIsNotDisposed ( ) : void

Method Details

BeginCall() public method

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. ///
return IAsyncResult

BeginNotify() public method

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. ///
return IAsyncResult

Call() public method

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. ///
return MessagePackObject

CallAsync() public method

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 . ///
return Task

Dispose() public method

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

EndCall() public method

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 . ///
return MessagePackObject

EndNotify() public method

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 . ///
return void

Notify() public method

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. ///
return void

NotifyAsync() public method

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 . ///
return Task

RpcClient() public method

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

RpcClient() public method

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. ///
return System

RpcClient() public method

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. ///
return System

RpcClient() public method

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. ///
return System

Shutdown() public method

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

ShutdownAsync() public method

Initiates shutdown of current connection.
public ShutdownAsync ( ) : Task
return Task