-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
QMP server - Connection Refused bug. #172
Comments
Thanks this may also be the issue in #130 |
Apple's API really sucks here. Why can't they return an error immediately if the connection fails? The code becomes real messy if we have to implement some state to track "are we retrying connection". |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
Related to pull request that I'm currently working on #113
UTM/Managers/UTMVirtualMachine.m
Lines 239 to 255 in c7ddf50
When the code between
_qemu_system startWithCompletion:
and_qemu connect
, executes quickly enough (in my case serial console connection don't take much time),UTMJSONStream
will fail to connect with Connection Refused error, because it is happening before qemu manages to start QMP server. In my code I duct taped it usingNSThread sleep
, but it's not perfect solution 😄.Possible solution
One possible solution is to design reconnection mechanism in
UTMJSONStream
.UTM/Managers/UTMJSONStream.m
Lines 53 to 70 in c7ddf50
connect
_inputStream/_outputStream open
, after receivingNSStreamEventErrorOccurred
and Connection refusedNSError
until number of trials is exceeded orNSStreamEventOpenCompleted
is received.The text was updated successfully, but these errors were encountered: