-
Notifications
You must be signed in to change notification settings - Fork 20
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
Never recieving messages to stream (half-open connection). #7
Comments
The If the link you request never ends, such as a living stream, then the Beside, when the CurlEasy reqeust was going to callback it would put it into a BTW, if you could provide a simple project to reproduce this issue would be much great helpful. |
Thanks for the quick reply! Carving out a 'simple' project is a bit hard since I need LoginWithAmazon and even a bunch more stood up to support creating a DownChannel with AVS. Using the
However, this never prints anything. Any thoughts there? Am I looking in the right place? Am I handling the response correctly? |
The If you just want the response headers, without any response body, you may try to set the
Then this request will auto abort after all the headers retrieved. If the server doesn't accept the HEAD method then you could try to use the default GET instead and set the option CURLOPT.NOBODY to true:
|
The directives endpoint has no body, so it makes sense that it's empty. But I want the response body as well. Let me try the CURLOPT setting. |
If you want the response body you should wait the request to finish. If you really want to access incoming data before it finishes you could take a look at the private member |
That makes sense, but the directives endpoint is designed to never close (unless you close it). I'll look at the responseBodyStream. |
That did it! I changed responseBodyStream to public and then do this in my ProgressCallback:
Any idea if there's a better way to implement this? I'm worried a bit about obliterating a message when I clear responseBodyStream. I'm also wondering if I should use a Coroutine or task to periodically query the responseBodyStream rather than the progressCallback, which seems to fire continuously. |
Yes you could access the stream in a coroutine if you make it thread safe, such as by adding some necessary locks. |
I'm using Curl Unity to connect to the HTTP/2 Alexa Voice Service directives endpoint. I've added the CurlMultiUpdater to a game object and I'm using the CurlMulti to create a downchannel connection like below (see AVS link for implementation details).
Unfortunately, no matter what I do, the OnPerformCallback (which creates a log entry and prints the inText output) is never called despite knowing that directives should be being sent to the application. It leads me to believe something must be wrong with the stream or connection that's created, or am I just missing something in the connection creation?
The text was updated successfully, but these errors were encountered: