-
Notifications
You must be signed in to change notification settings - Fork 468
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow multiple connection to debugserver when running with --nolldb #527
Allow multiple connection to debugserver when running with --nolldb #527
Conversation
🥲 |
Sorry that I managed to miss this and it did not pop up in my radar in the last 6 months. I will review this today |
src/ios-deploy/ios-deploy.m
Outdated
server_callback (CFSocketRef s, CFSocketCallBackType callbackType, CFDataRef address, const void *data, void *info) | ||
|
||
CFSocketContext get_socket_context(int connection_id) { | ||
CFSocketContext context = { 0, (void*)CFNumberCreate(NULL, kCFNumberIntType, &connection_id), NULL, NULL, NULL }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These calls to CFNumberCreate
need to be CFRelease
'd. You may need to pass around a CFNumber
instead of an int and the caller handles releasing the CFNumber.
src/ios-deploy/ios-deploy.m
Outdated
{ | ||
CFMutableDictionaryRef connection_properties = get_connection_properties(connection_id); | ||
|
||
ServiceConnRef dbgServiceConnection = (ServiceConnRef)CFDictionaryGetValue(connection_properties, @"service_connection"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we store these dictionary keys that are used multiple times as CFString constants and replace the literals with the constants?
I just merged in #575 If we get the issues here addressed we should be able to merge this in as well and get them both into the same mainline release. |
d9246bc
to
4565f15
Compare
@gabebear, I've pushed some changes with a couple of improvements.
Also, I was thinking if we should have a separate flag to allow this "server" mode and keep the old behaviour for the simple |
I think we are OK without a server flag here. Ideally the old |
This PR causes launches with the
|
@Timen mind filing an issue for this? https://github.com/ios-control/ios-deploy/issues/new If not, we will test this and get it filed later. I haven't tried to repro this yet, but it can sometimes help to have versions of Xcode/gcc/etc when tracking down bugs. |
done: #578 |
Fix #523: Allow server mode for debugserver
With this, when running with
--nolldb
, we create a new debugserver connection every time we accept a connection on the local port and start the proxy loop. This way, multiple connections including simultaneous connections are possible as long as the device is connected.This still does not behave nicely when device disconnects and reconnects.