jensmeder / DarkLightning

Simply the fastest way to transmit data between iOS/tvOS and OSX
MIT License
333 stars 39 forks source link

JMMobileDevicePort crashes when unplugging USB while writing data #34

Closed kirankunigiri closed 7 years ago

kirankunigiri commented 7 years ago

I'm using writeData() on a JMMobileDevicePort instance once every 0.01 seconds. However, when I disconnect the USB device, the connection is being disrupted at the same time it writes the data, and the app crashes. Is a workaround or a fix possible for this?

jensmeder commented 7 years ago

I assume the underlying NSOutputStream crashes (NSOutputStream is prone to crashes). Might be possible to do a quick fix in the writeData method on JMSocketConnection. I'll have a look at it.

jensmeder commented 7 years ago

I have found the cause of the bug and just pushed a fix. Will publish a new release of DarkLightning in the next hour. Sorry for the delay!

You can check it out on this branch.

Thanks for reporting the bug!

jensmeder commented 7 years ago

Fixed in 1.0.2