Sending events to all clients

3 messages Options
Embed this post
Permalink
Mathias Heyer

Sending events to all clients

Reply Threaded More More options
Print post
Permalink
Some javascript/style in this post has been disabled (why?)

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


_______________________________________________
eq-dev mailing list
[hidden email]
http://www.equalizergraphics.com/cgi-bin/mailman/listinfo/eq-dev
http://www.equalizergraphics.com
Dan Wilcox

Re: Sending events to all clients

Reply Threaded More More options
Print post
Permalink
Some javascript/style in this post has been disabled (why?)
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

_______________________________________________
eq-dev mailing list
[hidden email]
http://www.equalizergraphics.com/cgi-bin/mailman/listinfo/eq-dev
http://www.equalizergraphics.com
Stefan Eilemann

Re: Sending events to all clients

Reply Threaded More More options
Print post
Permalink
In reply to this post by Mathias Heyer

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
[hidden email]
http://www.equalizergraphics.com/cgi-bin/mailman/listinfo/eq-dev
http://www.equalizergraphics.com