Skip to content

How properly close connection with iPhone ? #150

@MairwunNx

Description

@MairwunNx

I using usbmuxd for android, I little bit edit main.c in usbmuxd/src/ and added __android_main like main func. With little difference like, specified device descriptor, auto discovery is disabled, and with some tweaks which makes works on android side.

But how to terminate connection? For example, I have BroadcastReceiver with DISCONNECT event

Currently I wrote this:

LOGD("Stopping usbmuxd service");

  should_exit = 1;

  if (device_descriptor != 0)
  {
    LOGD("Killing all connections");
    device_kill_connections();

    LOGD("Shutting down USB");
    usb_shutdown();

    LOGD("Shutting down device");
    device_shutdown();

    LOGD("Shutting down client");
    client_shutdown();

    device_descriptor = 0;
  }

  LOGD("Usbmuxd shutdown complete");

But this implementation lead to sigsegv

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions