[muscle] Re: Server design

  • From: Jeremy Friesner <jaf@xxxxxxxxxxxx>
  • To: muscle@xxxxxxxxxxxxx
  • Date: Tue, 04 Nov 2003 10:29:35 -0800

Hi Marius,

Check out the methods SaveNodeTreeToMessage() and
RestoreNodeTreeFromMessage() in the StorageReflectSession class.  These
will take the entire sub-tree starting at the DataNode you pass in and
archive it into a single Message object, which you can then send to a
client, save to disk, print to stdout, or do whatever with.

Note that muscled doesn't have any mechanism by which a client can
access these functions, so you would need to make an extended daemon (as
described previously) in order to have these methods called when you
wanted them to be.

Jeremy

On Tue, 2003-11-04 at 06:59, Marius Kjeldahl wrote:
> Thanks for the excellent links to more information about MUSCLE. Another=20
> question:
> 
> Has anybody made a utility to dump/output the entire tree in a server? I've=
> =20
> fooled around with the programs in the "tests" directory, but have not foun=
> d=20
> any easy way/program to dump the entire state tree.
> 
> If not, I guess it would be a good "tutorial assignment" for me.
> 
> Regards,
> 
> Marius Kjeldahl
> 
> On Tuesday 04 November 2003 01:16, Jeremy Friesner wrote:
> > Hi Marius,
> >=20
> >
> > >I stumbled on MUSCLE while researching toolkits for client/server
> > > application =0D toolkits, and based on the information I have read so f=
> ar,
> > > it looks like a very solid design.
> >
> >=20
> > Thanks :^)
> >=20
> >
> > >1) Server design. Should I plan on extending the muscled daemon, adding =
> my
> > > own =0D authentication layer and session logic, or would it be just as =
> good
> > > just to have a "server" as a separate process to another muscled proces=
> s,
> > > where my "server" (typically running centrally under my control) would
> > > take care of controlling which messages gets distributed to what clients
> > > through the muscled daemon?
> >
> >=20
> > Typically the server is a process that you manually start on the=20
> > server computer, similar to how muscle's built-in muscled executable
> > works.=0D=20
> > The best way to do it is to make your own subclass of the
> > StorageReflectSession =0D class (or AbstractReflectSession if you don't
> > want/need the database or live query features) and add in any necessary
> > custom logic there.  You may also find it useful to make a "persistent
> > state session" that contains state information that isn't specific to any
> > particular client.  This session would not be associated with any
> > particular client, but would hang around permanently and interact with the
> > clients' sessions.
> >=20
> > If you haven't seen it already, be sure to read this article:
> >    http://www.lcscanada.com/muscle/muscle/html/Custom%20Servers.html
> >=20
> >
> > >2) Has anybody added SSL transport support?
> >
> >=20
> > Not that I'm aware of.  But if you end up making an SSLDataIO wrapper
> > class, I'd be happy to add it to the distribution!
> >=20
> >
> > >3) Anywhere I can look for more documentation or application examples?
> >
> >=20
> > Check out this article I wrote about multiplayer games
> > with MUSCLE, it includes an example multiplayer game
> > (only Windows binary and source links are working though,
> > the other files seem to have disappeared from the server :^( )
> >=20
> > http://www.osnews.com/story.php?news_id=3D1523
> >=20
> > Also, feel free to ask more questions here!  :^)
> >=20
> > Jeremy
> 



Other related posts: