[eq-dev] Sending events to all clients

0 views
Skip to first unread message

Mathias Heyer

unread,
Aug 26, 2009, 10:39:37 AM8/26/09
to eq-...@equalizergraphics.com

Hi,

 

as far as I know, the event-mechanism is able to forward render client-local events to the application node.

Is there a similar way to send events from the application node to (all) the render clients?

 

 

Thanks in adavance,

 

Mathias

Dan Wilcox

unread,
Aug 27, 2009, 11:15:49 AM8/27/09
to Equalizer Developer List
On Wed, 2009-08-26 at 16:39 +0200, Mathias Heyer wrote:
Hi,

 

as far as I know, the event-mechanism is able to forward render client-local events to the application node.

Is there a similar way to send events from the application node to (all) the render clients?

Hey Mathias,

I do this by grabbing events in Config::handleEvent, adding them to an Event vector in FrameData which is sent to the clients.

On the client end, you just throw all the events in the received vector to the clients Config by calling Config::handleEvent directly.

The only problem would be if the sending node processes its own event which results in an event loop ... I just wrap the event with a struct that includes the nodes id to avoid this.

This setup seems to work fine to automatically send input (mouse/keyboard) events so far, as well as for a custom synched event structure ...

----
Dan Wilcox
Creative Engineering
Ars Electronica Futurelab

Stefan Eilemann

unread,
Sep 1, 2009, 6:08:47 AM9/1/09
to Equalizer Developer List

On 26. Aug 2009, at 16:39, Mathias Heyer wrote:

> as far as I know, the event-mechanism is able to forward render
> client-local events to the application node.
> Is there a similar way to send events from the application node to
> (all) the render clients?

Other than the solution described by Dan, no. We've been planning to
refactor the event system using a generic consumer/producer model for
some time, but nobody found the time to do it yet. These are my
thoughts so far:

Revamp Event Handling

Producer/Subscriber model

new: void Config::selectEvent( Event::Type type, net::NodeID node =
Node::ALL );
clearEvent( ... );

void Config::sendEvent( ConfigEvent event );
-> old: Sends event to appNode
-> new: Sends event to all subscribers
o appNode has default subscription to all events


Server subscribes to events for load-balancing
old: Channel::frameFinish sends all channel statistics in one batch
new: Channel select events if at least one listener is registered
Config (instead of channel) receives
at the end of each frame
for each channel
gather all events for channel
Channel::fireLoadData


Implementation

Each config instance has its own event mask for each subcriber
NodeID -> events

selectEvent( Event::Type type, net::NodeID node = Node::ALL );
(clearEvent)
if all nodes
send select packet to master
else
connect node
send select packet to node

_cmdSelectEvent()
(_cmdClearEvent)
if all nodes
assert is session master
for each node of session
send select packet to node
update own event list
else
update own event list
if no events left for subscriber, remove from map

void Config::sendEvent( ConfigEvent event )
for each subscriber
if event is selected
connect node
send event packet


Add tracking of nodes on session master:
during Node::_cmdMapSession, add slave nodes
during Node::_cmdUnmapSession, remove slave nodes


Cheers,

Stefan.


_______________________________________________
eq-dev mailing list
eq-...@equalizergraphics.com
http://www.equalizergraphics.com/cgi-bin/mailman/listinfo/eq-dev
http://www.equalizergraphics.com

Reply all
Reply to author
Forward
0 new messages