artehe / Netimobiledevice

A C#/dotnet implementation for working with iOS devices (iPhone, iPad, iPod).
https://github.com/artehe/Netimobiledevice
MIT License
14 stars 7 forks source link

TaskUnobservedException thrown when pairing asynchronously #7

Closed artehe closed 9 months ago

artehe commented 9 months ago

When using the LockdownClient.PairAsync a TaskUnobservedException will be raised a lot.

This comes from the function ReceiveWithTimeout in the ServiceConnection class which is mainly a hacky function I put together to deal with the fact that NetworkStream.ReadAsync by design doesn't actually timeout.

I think I should keep the function working the same but redo how the timeout part works so that we don't have this problem any more.