twitchdev / twitch-cli

The official Twitch CLI to make developing on Twitch easier.
Apache License 2.0
604 stars 71 forks source link

Added RPC command to disable keepalive messages for a client; #291 #303

Closed Xemdo closed 9 months ago

Xemdo commented 9 months ago

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Problem/Feature

Resolves #291 by adding the requested feature

Description of Changes:

Checklist

Xemdo commented 9 months ago

Running server in debug:

2023/12/29 00:44:11 Client connected [b5289805]
2023/12/29 00:44:11 [4d90be39] Connections: (1) [ b5289805 ]
2023/12/29 00:44:16 Sent pong to client [b5289805]
2023/12/29 00:44:21 Sent pong to client [b5289805]
2023/12/29 00:44:21 Sent session_keepalive to client [b5289805]
2023/12/29 00:44:26 Sent pong to client [b5289805]
2023/12/29 00:44:31 Sent pong to client [b5289805]
2023/12/29 00:44:31 Sent session_keepalive to client [b5289805]
2023/12/29 00:44:33 RPC set status on client feature [KeepAliveEnabled] for client [b5289805]: false
2023/12/29 00:44:36 Sent pong to client [b5289805]
2023/12/29 00:44:41 Skipped sending session_keepalive to client [b5289805]
2023/12/29 00:44:41 Sent pong to client [b5289805]
2023/12/29 00:44:46 Sent pong to client [b5289805]
2023/12/29 00:44:51 Skipped sending session_keepalive to client [b5289805]
2023/12/29 00:44:51 Sent pong to client [b5289805]
2023/12/29 00:44:56 Sent pong to client [b5289805]
2023/12/29 00:45:01 Skipped sending session_keepalive to client [b5289805]
2023/12/29 00:45:01 Sent pong to client [b5289805]
2023/12/29 00:45:06 Sent pong to client [b5289805]
2023/12/29 00:45:09 RPC set status on client feature [KeepAliveEnabled] for client [b5289805]: true
2023/12/29 00:45:11 Sent pong to client [b5289805]
2023/12/29 00:45:11 Sent session_keepalive to client [b5289805]

Without --debug flag, "RPC set status on [...]" line will still appear, but "_Skipped sending sessionkeepalive to client [...]" line only appears when using debug flag.

SputNikPlop commented 9 months ago

tested and LGTM