Skip to content

SocketException: The semaphore timeout period has expired #61939

@ali-1989

Description

@ali-1989

I take this exception and my app killed.

  • The Dart version : 3.9.2
  • Windows 10
Unhandled exception:
SocketException: The semaphore timeout period has expired.
 (OS Error: The semaphore timeout period has expired.
, errno = 121), address = tbox.trip.dotone.ir, port = 57527

my ways:

try{
      _mqt ??= MqttService(option);

      final connected = await _mqt!.connect();

      if(connected){
        _subscribeTopic();
      }
    }
    catch (e){}

AND

try{
      _mqt ??= MqttService(option);

      final connected = await _mqt!.connect().catchError((e)=> false));

      if(connected){
        _subscribeTopic();
      }
    }
    catch (e){}

Main:

void main(List<String> arguments) async {
  await runZonedGuarded(() async {
    try{
      await mainApp();
    }
    catch (e, s){
      print('');
    }
  }, zonedGuardedCatch);
}

but I can not catch error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3A lower priority bug or feature requestarea-vmUse area-vm for VM related issues, including code coverage, and the AOT and JIT backends.library-iotriagedIssue has been triaged by sub team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions