centrifugal / centrifuge-dart

Dart (Flutter) client SDK for bidirectional communication with Centrifugo and Centrifuge-based server over WebSocket
https://pub.dartlang.org/packages/centrifuge
MIT License
110 stars 34 forks source link

Unable to send RPC request #33

Closed Holofox closed 4 years ago

Holofox commented 4 years ago

Hello again! I noticed that RPC requests are not sent. The problem occurs when deserializing and serializing data. Shouldn't we use the type Uint8List instead of List<int>?

To clarify the situation, now the centrifuge client on Dart allows you to send RPC requests in binary form (List<int>).

Before bringing to this form, I convert the bodies of an RPC request through the .writeToBuffer() or

utf8.encode(jsonEncode(request.toProto3Json());

method, it is worth noting that the binary result of these operations is different;

What should I do to correctly send a request? A little later I will try to supplement the information about the problem I am facing.

FZambia commented 4 years ago

@Holofox hello, I don't have quick answer since I am not a Dart developer in general, will try to reproduce this as soon as I can.

@mogol do you have time to look at this question?

FZambia commented 4 years ago

@Holofox added sending RPC to console example, see https://github.com/centrifugal/centrifuge-dart/blob/master/example/console/simple.dart#L68