Giter VIP home page Giter VIP logo

Comments (4)

eduard-vasinskyi avatar eduard-vasinskyi commented on June 21, 2024 1

@anboo44
The serializer must know which message type to decode. To do this, an index is assigned to each message type. The client serializer then encodes the index of the message type.

It is not possible to make a client that knows nothing about other message types.
Alternatively, you can create multiple RPC servers, each handling a different message type, and configure them to listen on different ports. This way, each client will connect to the desired server and will not need to know about the other message types.

from activej.

eduard-vasinskyi avatar eduard-vasinskyi commented on June 21, 2024

Hi, @anboo44
I have not been able to reproduce the problem. I have configured the RPC server the same way as you did, but the messages are serialized correctly.
Can you check that the message types (and their order) in RpcClient#withMessageTypes match the message types in RpcServer#withMessageTypes? If so, could you please create a test or demo project demonstrating the serializer issue?

I want to class types don't care their order in withMessageTypes.

To build compatible message serializers, the configuration of message types (the order of message types) must be the same on both the RPC client and the server.

from activej.

anboo44 avatar anboo44 commented on June 21, 2024

@eduard-vasinskyi I recognize that RpcClient#withMessageTypes and RpcServer#withMessageTypes are not matched. After i change them, it is OK. Thank you.

Assumed, RpcServer handles types: String, Integer, Boolean with 3 RpcClients
RpcClient_1 only uses String
RpcClient_2 only uses Integer
RpcClient_3 only uses Boolean
=> In order to work, RpcClient_1, RpcClient_2, RpcClient_3 must be the same with RpcServer. I think it isn't convenient.
Does the way have to change this in next versions ?
It will be great, if RpcClient only declares its types

from activej.

anboo44 avatar anboo44 commented on June 21, 2024

@eduard-vasinskyi I got it. Thank you so much

from activej.

Related Issues (20)

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.