@@ -23,10 +23,10 @@ class NgConnection implements Connection {
23
23
24
24
NgConnection ._();
25
25
26
- late TSocketTransport socketTransport;
27
- late TFramedTransport transport;
28
- late THeaderProtocol protocol;
29
- late GraphServiceClient client;
26
+ late ng. TSocketTransport socketTransport;
27
+ late ng. TFramedTransport transport;
28
+ late ng. THeaderProtocol protocol;
29
+ late ng. GraphServiceClient client;
30
30
late Map <String , dynamic > properties;
31
31
int ? _sessionId;
32
32
int ? timezoneOffset;
@@ -41,19 +41,19 @@ class NgConnection implements Connection {
41
41
/// 因为连接还没有打开。
42
42
NgConnection ._create (Uri address, {Map <String , dynamic >? properties}) {
43
43
this .properties = properties ?? < String , dynamic > {};
44
- socketTransport = TSocketTransport (
44
+ socketTransport = ng. TSocketTransport (
45
45
host: address.host,
46
46
port: address.port,
47
47
connectionTimeout: properties? [timeoutKey] ?? 6000 ,
48
48
);
49
49
50
- transport = THeaderTransport (
50
+ transport = ng. THeaderTransport (
51
51
transport: socketTransport,
52
- clientTypes: [ClientTypes .HEADERS ],
52
+ clientTypes: [ng. ClientTypes .HEADERS ],
53
53
supportedClients: [false ]);
54
54
55
- protocol = THeaderProtocol (transport);
56
- client = GraphServiceClient (protocol);
55
+ protocol = ng. THeaderProtocol (transport);
56
+ client = ng. GraphServiceClient (protocol);
57
57
}
58
58
59
59
/// Invoked in [DriverManager.getConnection] , after the connection created.
@@ -73,10 +73,10 @@ class NgConnection implements Connection {
73
73
/// 检查客户端和服务端的版本是否兼容
74
74
/// 如果不兼容,抛出异常
75
75
Future <void > verifyVersion () async {
76
- VerifyClientVersionResp resp =
77
- await client.verifyClientVersion (VerifyClientVersionReq ());
76
+ ng. VerifyClientVersionResp resp =
77
+ await client.verifyClientVersion (ng. VerifyClientVersionReq ());
78
78
79
- if (resp.error_code != ErrorCode .SUCCEEDED ) {
79
+ if (resp.error_code != ng. ErrorCode .SUCCEEDED ) {
80
80
throw VersionException (
81
81
message: String .fromCharCodes (resp.error_msg ?? []));
82
82
}
@@ -86,12 +86,12 @@ class NgConnection implements Connection {
86
86
///
87
87
/// 认证用户
88
88
Future <void > authencate () async {
89
- AuthResponse resp = await client.authenticate (
89
+ ng. AuthResponse resp = await client.authenticate (
90
90
Int8List .fromList (utf8.encode (properties[DriverManager .usrKey] ?? '' )),
91
91
Int8List .fromList (utf8.encode (properties[DriverManager .pwdKey] ?? '' )),
92
92
);
93
93
94
- if (resp.error_code != ErrorCode .SUCCEEDED ) {
94
+ if (resp.error_code != ng. ErrorCode .SUCCEEDED ) {
95
95
if (resp.error_msg != null ) {
96
96
throw ConnectException (message: String .fromCharCodes (resp.error_msg! ));
97
97
} else {
0 commit comments