-
Notifications
You must be signed in to change notification settings - Fork 40
/
connection_settings.dart
54 lines (42 loc) · 1.38 KB
/
connection_settings.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
part of "../client.dart";
class ConnectionSettings {
// The host to connect to
String host;
// The port to connect to
int port;
// The connection vhost that will be sent to the server
String virtualHost;
// The max number of reconnection attempts before declaring a connection as unusable
int maxConnectionAttempts;
// The time to wait before trying to reconnect
Duration reconnectWaitTime;
// Authentication provider
Authenticator authProvider;
// Protocol version
int amqpProtocolVersion = 0;
int amqpMajorVersion = 0;
int amqpMinorVersion = 9;
int amqpRevision = 1;
// Tuning settings
TuningSettings tuningSettings;
// TLS settings (if TLS connection is required)
SecurityContext? tlsContext;
bool Function(X509Certificate)? onBadCertificate;
// Connection identifier
String? connectionName;
// The time to wait for socket connection to be established
Duration? connectTimeout;
ConnectionSettings({
this.host = "127.0.0.1",
this.port = 5672,
this.virtualHost = "/",
this.authProvider = const PlainAuthenticator("guest", "guest"),
this.maxConnectionAttempts = 1,
this.reconnectWaitTime = const Duration(milliseconds: 1500),
TuningSettings? tuningSettings,
this.tlsContext,
this.onBadCertificate,
this.connectionName,
this.connectTimeout,
}) : tuningSettings = tuningSettings ?? TuningSettings();
}