Skip to content

Commit

Permalink
feat: improve client
Browse files Browse the repository at this point in the history
  • Loading branch information
santitigaga committed Feb 6, 2025
1 parent 50bc599 commit ea9d8ed
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 9 deletions.
2 changes: 2 additions & 0 deletions clients/client-dart/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# CHANGELOG
## [2.0.4]
- Fix reconnection with heartbeats issue
## [2.0.3]
- Improve logs
- Refactor
Expand Down
3 changes: 1 addition & 2 deletions clients/client-dart/lib/src/async_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import 'package:web_socket_channel/io.dart';
import 'async_config.dart';
import 'channel_message.dart';
import 'retry_timer.dart';
import 'status_codes.dart';
import 'transport.dart';

/// Async Data Flow Low Level Client
Expand Down Expand Up @@ -217,7 +216,7 @@ class AsyncClient {
Future<bool> disconnect() async {
_log.finer('async-client. disconnect() called');

await _transport?.close(StatusCodes.ok, 'Client disconnect');
await _transport?.close(1000, 'Client disconnect');
_connectRetryTimer.reset();
_log.finer('async-client. async-client. disconnect() called end');

Expand Down
3 changes: 0 additions & 3 deletions clients/client-dart/lib/src/status_codes.dart

This file was deleted.

6 changes: 3 additions & 3 deletions clients/client-dart/lib/src/transport.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import 'binary_decoder.dart';
import 'channel_message.dart';
import 'json_decoder.dart';
import 'message_decoder.dart';
import 'status_codes.dart';

class Transport {
MessageDecoder msgDecoder = JsonDecoder();
Expand Down Expand Up @@ -116,7 +115,7 @@ class Transport {
}

_signalSocketClose(
_webSocketCh.closeCode ?? StatusCodes.ok,
_webSocketCh.closeCode ?? 1000,
_webSocketCh.closeReason ?? '',
);
}
Expand Down Expand Up @@ -152,7 +151,8 @@ class Transport {
void _abnormalClose(reason) {
_log.warning('async-client. Abnormal Close');
_closeWasClean = false;
_webSocketCh.sink.close(StatusCodes.ok, reason);
const heartbeatCode = 3051;
_webSocketCh.sink.close(heartbeatCode, reason);
}

String _makeRef() {
Expand Down
2 changes: 1 addition & 1 deletion clients/client-dart/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: channel_sender_client
description: Client for Async DataFlow Channel Sender
version: 2.0.3
version: 2.0.4
homepage: https://github.com/bancolombia/async-dataflow
repository: https://github.com/bancolombia/async-dataflow.git

Expand Down

0 comments on commit ea9d8ed

Please sign in to comment.