google / google/sync_http.dart

_nativeGetRemotePeer() throws or returns an exception whenever remoteAddress Socket's property getter is called!

Open
#26 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Dart
Stars
18
Forks
16
PR merge metrics
No merged PRs in 30d

Description

Dart SDK Version (`dart --version`): `Dart SDK version: 2.16.1 (stable) (Tue Feb 8 12:02:33 2022 +0100) on "linux_x64"`
Operating System: `Linux` `UBUNTU`.

`_nativeGetRemotePeer()` throws exception whenever remoteAddress Socket's property getter is called!

This `_nativeGetRemotePeer()` function appears to be a C native function called by Dart code.

This function is called or referenced in sync_socket_patch.dart file that lives in /home/$USER/snap/flutter/common/flutter/bin/cache/dart-sdk/lib/_internal/vm/bin/sync_socket_patch.dart.

Here is the error I get whenever `remoteAddress` property gets called:
```
' of 'function result'
#0 _NativeSynchronousSocket._nativeGetRemotePeer (dart:io-patch/sync_socket_patch.dart)
#1 _NativeSynchronousSocket.remoteAddress (dart:io-patch/sync_socket_patch.dart:136:18)
#2 _RawSynchronousSocket.remoteAddress (dart:io-patch/sync_socket_patch.dart:28:48)
#3 _RawSynchronousSocket.Eval ()
#4 _RawSynchronousSocket.Eval ()
#5 new SyncHttpClientResponse.processLine (package:sync_http/src/sync_http.dart:403:9)
#6 _LineDecoder._process (package:sync_http/src/line_decoder.dart:45:16)
#7 _LineDecoder.close (package:sync_http/src/line_decoder.dart:49:19)
#8 new SyncHttpClientResponse (package:sync_http/src/sync_http.dart:422:21)
#9 SyncHttpClientRequest.close (package:sync_http/src/sync_http.dart:104:12)
#10 main (package:sync_http/main.dart:41:26)
#11 _delayEntrypointInvocation. (dart:isolate-patch/isolate_patch.dart:295:32)
#12 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:192:12)>
```

The socket is connected and there is a remote address value when this call occurs .. the values of `isClosed` & `isClosedRead` & `isClosedWrite` properties of the `_socket` object as instance of `_NativeSynchronousSocket` are both equal to `false`.

Would you kindly advise?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.