i have extended the ModuleBase class creating an application that manages clients that both publish a live stream and subscribe to live streams.
in other words a kind of video chat rooms (except that rooms are referred to as channels in the application).
in each channel up to 8 clients can publish their own stream, and subscribe to each other streams.
channels and clients are handle in memory using a Hashtable, so for example between onConnect and onConnectAccept i get from the client the channel name, if the channel name does not exists in the hashtable, it is created, then the new client is inserted in the channel and the channel is inserted in the hashtable.
the above interaction is easy to manage when there is only one WMS running.
now i would like to implement load balancing (for edge servers) and a live repeater (origin/edge).
question 1 is:
1) is the following scenario correct ?
assuming i have 3 servers:
One server acts as load-balancer and originator (called for example origin)
Two servers are the edges. (for example edge1 and edge2)
1) a client (called client1) connects to the load-balancer, this redirects the request to the less busy edge for example edge1
2) edge1 accepts the connection and when a published stream arrives (from client1) it forwards it to the origin
3) the origin repeats back the published stream to edge1 and edge2
4) a second client (client2) want to subscribe to the stream published by client1
5) client2 will be redirected (by the LB) to for example edge2, and edge2 will stream to client2 the stream received by the origin (and belonging to client1)
question 2 is:
am i right in thinking that the current way i manage channels and clients (the hashtable) will not work in the above scenario ?
question 3 is:
should i keep management/track of the channels and clients per channels in the origin server only (i.e. not on the edges)
sorry for long question