Skip to content
This repository has been archived by the owner on Oct 28, 2024. It is now read-only.

Added the ability to pass in a custom Json RPC ID #92

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/src/client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ class Client {
///
/// Throws a [StateError] if the client is closed while the request is in
/// flight, or if the client is closed when this method is called.
Future sendRequest(String method, [Object? parameters]) {
var id = _id++;
Future sendRequest(String method, [Object? parameters, int? id]) {
id ??= _id++;
_send(method, parameters, id);

var completer = Completer.sync();
Expand Down
4 changes: 2 additions & 2 deletions lib/src/peer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ class Peer implements Client, Server {
// Client methods.

@override
Future sendRequest(String method, [Object? parameters]) =>
_client.sendRequest(method, parameters);
Future sendRequest(String method, [Object? parameters, int? id]) =>
_client.sendRequest(method, parameters, id);

@override
void sendNotification(String method, [Object? parameters]) =>
Expand Down