@@ -61,9 +61,8 @@ void main(List<String> args) async {
61
61
stdout.writeln ('listening on host ${server .address .address }:${server .port }' );
62
62
server.listen ((Socket client) {
63
63
stdout.writeln ('client connected ${client .remoteAddress .address }:${client .remotePort }' );
64
-
65
64
client.listen ((Uint8List data) {
66
- final int fnameLen = data.buffer.asByteData ().getInt32 (0 );
65
+ final int fnameLen = data.buffer.asByteData (0 , 4 ).getInt32 (0 );
67
66
final String fileName = utf8.decode (data.buffer.asUint8List (4 , fnameLen));
68
67
final Uint8List fileContent = data.buffer.asUint8List (4 + fnameLen);
69
68
log ('host received ${fileContent .lengthInBytes } bytes for screenshot `$fileName `' );
@@ -79,11 +78,15 @@ void main(List<String> args) async {
79
78
final Future <void > comparison = skiaGoldClient!
80
79
.addImg (fileName, goldenFile, screenshotSize: fileContent.lengthInBytes)
81
80
.catchError ((dynamic err) {
82
- panic (< String > ['Skia gold comparison failed: ${err .toString ()}' ]);
81
+ panic (< String > ['skia gold comparison failed: ${err .toString ()}' ]);
83
82
});
84
83
pendingComparisons.add (comparison);
85
84
}
86
- });
85
+ },
86
+ onError: (dynamic err) {
87
+ panic (< String > ['error while receiving bytes: ${err .toString ()}' ]);
88
+ },
89
+ cancelOnError: true );
87
90
});
88
91
});
89
92
@@ -121,9 +124,9 @@ void main(List<String> args) async {
121
124
await step ('Skia Gold auth...' , () async {
122
125
if (isSkiaGoldClientAvailable) {
123
126
await skiaGoldClient! .auth ();
124
- log ('Skia gold client is available' );
127
+ log ('skia gold client is available' );
125
128
} else {
126
- log ('Skia gold client is unavailable' );
129
+ log ('skia gold client is unavailable' );
127
130
}
128
131
});
129
132
0 commit comments