TwitchAPI disconnects every 30 minutes #38
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
So apparently the client connection cannot stay open forever and it disconnects after some time.
Same issue, but I still need to update gift to the latest build,but it does seem to disconnect (since December) . If I got any valuable debug information I will add it here.
This issue should be renamed: I dug a little more into HTTPClient class to figure out what was wrong.
I was getting the error:
request: Condition "status != STATUS_CONNECTED" is true. Returned: ERR_INVALID_PARAMETER
when using requests from the
TwitchAPIConnection
.I believe the problem was related to having a request call while
client.get_status() == HTTPClient.STATUS_BODY
.My hacky and NOT IDEAL solution has been to wait to finish polling the body within the
request
function.Original code in
TwitchAPIConnection
:My edits to code in
TwitchAPIConnection
:I am not confident in my network connection knowledge, so I won't suggest this as a definitive solution. But I hope this can help somehow.
If I have any updates or more errors related to connectivity I'll post them here.
Btw thank you issork for your amazing work!
EDIT: In the original response I used
OS.delay_msec(50)
which is a blocking thread solution. Not ideal. So I changed it toawait get_tree().create_timer(0.1).timeout
Nice work @iRadEntertainment !
I get this as my output currently in debug mode (as spam) :
At: res://addons/gift/gift_node.gd:292:_process() Connecting to Twitch IRC. Reconnecting to Twitch...
So it probably is indeed to do with re-establishing of the connection. Also I have been tinkering with other APIs and the reconnection problem is also found in a few other APIs, if I read their message boards. So perhaps something has changed since last year that breaks some connection codes.
This week I should be able to test a few setups as well, if I can add any fresh findings to this discussion I will. My speciality is not really in networking so lets see how it goes.
Can't seem to use the updated
get_tree()
code because the current TwitchAPIConnection extends RefCounted which is not a Node. Had to go back to using the blocking sleep, feels bad, but works?EDIT: I still get eventual disconnects and status -1