Giter Club home page Giter Club logo

msgpack-rpc-cli's Introduction

MessagePack RPC for CLI Readme

What is it?

This is MessagePack RPC for CLI (Common Language Infrastructure) implementations such as .NET Framework, Silverlight, Mono (including Moonlight.) This library can be from ALL CLS compliant languages such as C#, F#, Visual Basic, Iron Pyhton, Iron Ruby, PowerShell, C++/CLI or so.

Documentation

See wiki

How to build

For .NET Framework

  1. Install recent Windows SDK (at least, .NET Framework 4 Full Profile and MSBuild is needed.) Or install Visual Studio or Visual Studio Express.
    1. If you want to build unit test assemblies, install NuGet.
  2. Run: msbuild MsgPack.csproj Or open MsgPack-RPC.sln in your IDE and run build command in it.

For Mono

Open MsgPack-RPC.mono.sln in MonoDevelop and build it. (You might be able to build via xbuild.)

See also

Wiki : https://github.com/yfakariya/msgpack-rpc-cli/wiki Issue tracker : https://github.com/yfakariya/msgpack-rpc-cli/issues MSBuild reference : http://msdn.microsoft.com/en-us/library/0k6kkbsd.aspx (You can see translated version by changing "en-us" to some locale as you like (e.g. "ja-jp".) Mono xbuild reference : http://www.mono-project.com/Microsoft.Build

msgpack-rpc-cli's People

Contributors

yfakariya avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

msgpack-rpc-cli's Issues

The client hangs after multiple calls

I tried a server implementations like this:

import msgpackrpc

class TestServer(object):
    def Add(self, a, b):
        print("Add({}, {}) called".format(a, b))
        return a + b

    def Mul(self, a, b):
        print("Mul({}, {}) called".format(a, b))
        return a * b

server = msgpackrpc.Server(TestServer())
server.listen(msgpackrpc.Address("localhost", 8070))
server.start()

The client looked like this:

    public partial class Form1 : Form
    {
        private RpcClientConfiguration _clientConfig = new RpcClientConfiguration();
        private dynamic _rpcProxy;

        public Form1()
        {
            InitializeComponent();
            _rpcProxy = new DynamicRpcProxy(new DnsEndPoint("127.0.0.1", 8070), _clientConfig);
        }

        ~Form1()
        {
            _rpcProxy.Dispose();
        }

        private void btnAdd_Click(object sender, EventArgs e)
        {
            for (int i = 0; i < 50; ++i)
            {
                var result = (int) _rpcProxy.Add(Convert.ToInt32(i), Convert.ToInt32(tbB.Text));
                lblResult.Text = String.Format("Result: {0}", result);
                Thread.Sleep(100);
            }
        }

        private void btnMul_Click(object sender, EventArgs e)
        {
            var result = (float)_rpcProxy.Mul(Convert.ToSingle(tbA.Text), Convert.ToSingle(tbB.Text));
            lblResult.Text = String.Format("Result: {0}", result);
        }
    }

(I also tried a C++ server implementation but I'll omit that for brevity; I had the same results with it.)

What happens is after the 10th or so call the application hangs. It always hangs on this line: https://github.com/yfakariya/msgpack-rpc-cli/blob/master/src/MsgPack.Rpc.Client/Rpc/Client/AsyncResult.cs#L224

I does not matter how much I wait between the calls, it can even be as long as two seconds per call.
Am I doing something wrong with the client or is this a bug?

Example Request

Hello. Me and my colleague are trying to use your msgpack-rpc-cli implementation in C#, however we are having difficulties understanding how we can create a service that the server can provide to the client.

We tried following your Quick Start instructions, but we are still having some difficulties.

So we would like to ask you if you can provide a simple example that we can run and test on Visual Studio. We believe if we have an example with a client and server interacting we can build our application from that.

Thank you for your time, best regards.

Provide example of user-defined class as RPC return type. (C#)

I am trying to call an RPC function bar() that returns a value of type Foo. Foo is an identical class on both the server and client.

The dynamic proxy always returns a MessagePackObject, and it's possible to dynamically cast this to a basic type (i.e. ulong). But a compile-time error results if I try to cast it to Foo.

I understand that a serializer for Foo can be created and registered in the SerializationContext, but this doesn't change the fact that I can't perform a cast upon the MessagePackObject returned by the call.

Is it possible to convert the return value to Foo? If it is, could someone please provide a simple example?

can not build mono project

Even I change the msgpack-cli ref to 4.0 version, it seem not build successful.

the error : Error CS1061: 'MsgPack.Unpacker' does not contain a definition for 'TryRead' and no extension method 'TryRead' accepting a first argument of type 'MsgPack.Unpacker' could be found (are you missing a using directive or an assembly reference?) (CS1061) (MsgPack.Rpc.Mono)

And It also tips : Serialization not in MsgPack namespaces.

Usage with custom object serialization

Hi,

is it possible to use this framework but not use the default MsgPack object serialization?
I use the MsgPack c# bindings but use for all objects a customer serializer. But when I use the DynamicProxy for example, the framework would use the default MsgPack serialization.

So there some API to pass byte[] and only take advantage of the communication features?

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.