mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-11-17 09:47:37 +00:00
comment mutex code
This commit is contained in:
parent
7bb74455cd
commit
866b7c4e88
1 changed files with 8 additions and 1 deletions
|
@ -2,6 +2,7 @@ import 'dart:async';
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
import 'dart:typed_data';
|
import 'dart:typed_data';
|
||||||
|
// import 'package:mutex/mutex.dart';
|
||||||
|
|
||||||
import 'package:stackwallet/utilities/logger.dart';
|
import 'package:stackwallet/utilities/logger.dart';
|
||||||
|
|
||||||
|
@ -21,6 +22,8 @@ class JsonRPC {
|
||||||
Socket? socket;
|
Socket? socket;
|
||||||
StreamSubscription<Uint8List>? _subscription;
|
StreamSubscription<Uint8List>? _subscription;
|
||||||
|
|
||||||
|
// final m = Mutex();
|
||||||
|
|
||||||
void Function(List<int>)? _onData;
|
void Function(List<int>)? _onData;
|
||||||
void Function(Object, StackTrace)? _onError;
|
void Function(Object, StackTrace)? _onError;
|
||||||
|
|
||||||
|
@ -80,7 +83,9 @@ class JsonRPC {
|
||||||
if (socket != null) {
|
if (socket != null) {
|
||||||
// TODO check if the socket is valid, alive, connected, etc
|
// TODO check if the socket is valid, alive, connected, etc
|
||||||
}
|
}
|
||||||
// Do we need to check the subscription, too?w
|
// Do we need to check the subscription, too?
|
||||||
|
|
||||||
|
// await m.acquire();
|
||||||
|
|
||||||
if (useSSL) {
|
if (useSSL) {
|
||||||
socket ??= await SecureSocket.connect(host, port,
|
socket ??= await SecureSocket.connect(host, port,
|
||||||
|
@ -107,6 +112,8 @@ class JsonRPC {
|
||||||
|
|
||||||
socket?.write('$jsonRpcRequest\r\n');
|
socket?.write('$jsonRpcRequest\r\n');
|
||||||
|
|
||||||
|
// m.release();
|
||||||
|
|
||||||
return completer.future;
|
return completer.future;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue