-
Notifications
You must be signed in to change notification settings - Fork 41
/
Copy pathclient.dart
32 lines (24 loc) · 968 Bytes
/
client.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
part of "../client.dart";
abstract class Client {
factory Client({ConnectionSettings? settings}) =>
_ClientImpl(settings: settings);
// Configuration options
ConnectionSettings get settings;
TuningSettings get tuningSettings;
/// Check if a connection is currently in handshake state
bool get handshaking;
/// Open a working connection to the server. Returns a [Future] to be completed on a successful protocol handshake
Future connect();
/// Shutdown any open channels and disconnect the socket. Return a [Future] to be completed
/// when the client has shut down
Future close();
/// Allocate and initialize a new [Channel]. Return a [Future] to be completed with
/// the new [Channel]
Future<Channel> channel();
/// Register listener for errors
StreamSubscription<Exception> errorListener(
void Function(Exception error) onData,
{Function onError,
void Function() onDone,
bool cancelOnError});
}