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

Usbmux subscription callback stops working after 5 seconds #2

Closed Thomas-Vos closed 1 year ago

Thomas-Vos commented 1 year ago

Listen to connection events using the following code:

Usbmux.Subscribe(SubscriptionCallback);

private static void SubscriptionCallback(UsbmuxdDevice device, UsbmuxdConnectionEventType connectionEvent)
{
    Console.WriteLine("NewCallbackExecuted");
    Console.WriteLine($"Connection event: {connectionEvent}");
    Console.WriteLine($"Device: {device.DeviceId} - {device.Serial}");
}

After about 5 seconds the debugs logs show the following:

Exception thrown: 'System.Net.Sockets.SocketException' in System.Net.Sockets.dll

Now the subscription callback is no longer called when (dis)connecting a device. It seems there is some sort of timeout which is affecting the subscription.

Thomas-Vos commented 1 year ago

The current master branch does not seem to have this issue.