Skip to content
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

wayvncctl events #178

Merged
merged 6 commits into from
Nov 12, 2022
Merged

wayvncctl events #178

merged 6 commits into from
Nov 12, 2022

Conversation

lack
Copy link
Collaborator

@lack lack commented Nov 12, 2022

Adds server->client broadcast events

Read wayvnc.scd and wayvncctl.scd for an overview.

  • Ensure fatal errors are sent first
  • Add jsonipc event message constructor
  • Add server event infrastructure
  • Added event help text
  • Add generic yaml-like printing of event data
  • Add example event-watcher script

I have read and understood CONTRIBUTING.md and its associated documents.

@lack
Copy link
Collaborator Author

lack commented Nov 12, 2022

Valgrind looks good; no leaks.

Manual testing looks good too.

src/ctl-client.c Show resolved Hide resolved
connection_count_now "$count"
;;
esac
done < <("$WAYVNCCTL" --json event-receive)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be convenient to have an option to write the response to an environment variable so you can skip the read.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trying to think of how we can do that.

One idea I had was to introduce a "script mode" where a user could run wayvncctl --event-script=/path/to/executable and then we would run that executable once for every event, with some reasonable calling convention that puts the event details in the env and/or cmdline. But I think I'd want to do that in a separate PR.

src/ctl-client.c Outdated Show resolved Hide resolved
src/ctl-server.c Outdated Show resolved Hide resolved
wayvncctl.scd Outdated Show resolved Hide resolved
wayvncctl.scd Show resolved Hide resolved
src/ctl-server.c Outdated Show resolved Hide resolved
lack added 6 commits November 12, 2022 08:43
Once we start enqueueing asynchronous events, it's more important to
send fatal errors (which then disconnect) imediately by prepending them
to the send queue. Everything else is still processed FIFO.

Signed-off-by: Jim Ramsay <[email protected]>
Includes "client-connect" and "client-disconnect" events as
proof-of-concept.

Signed-off-by: Jim Ramsay <[email protected]>
Signed-off-by: Jim Ramsay <[email protected]>
@any1 any1 merged commit 3ee620b into any1:master Nov 12, 2022
@any1
Copy link
Owner

any1 commented Nov 12, 2022

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants