[vbox-dev] Passive event handling

Ian Moore imooreyahoo at gmail.com
Mon Oct 1 05:58:43 PDT 2012


I'm having some trouble following the passive event mechanism logic. I'm
working on a web application and it will periodically poll vboxwebsrv for
events. While this works well with the vbox event source, I'm not quite
sure how to implement this for individual machine console events. Should it
go like this:

1. Create an event listener when a running machine is selected
--- machine = vbox->findMachine(...)
--- session = websessionManager->getSessionObject()
--- listener = session->console->eventSource->createListener()
--- session->console->eventSource->registerListener(listener,...,false)
--- session->unlock(machine)

2. Then periodically poll for events. Each poll cycle would
--- machine = vbox->findMachine(...)
--- session = websessionManager->getSessionObject()
--- while(event = session->console->eventSource->getEvent(listener created
in step #1)) { ... }
--- session->unlock(machine)

Should I leave the shared lock in place (leaving session->console
available) until the machine is deselected or stopped? I tried looking
through the VirtualBox source, but was unable to determine how it should

Thank you for any help!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.virtualbox.org/pipermail/vbox-dev/attachments/20121001/dca74798/attachment-0002.html 

More information about the vbox-dev mailing list