[muscle] Re: reset the session identity counter?

  • From: "Jeremy Friesner" <jaf@xxxxxxxxxxxx>
  • To: "David Svanberg" <ds@xxxxxxxxxxx>
  • Date: Wed, 21 Jan 2004 02:07:52 PST (-0800)

> Howdy MUSCLE neerds!

Hiya ;^)
 
> Is it possible to reset the session identity counter=3F

Only by killing and re-starting the muscled process, or by hacking the muscle 
souce code to cause it to be reset.  The reason the counter is never reset is 
so that there will never be any re-use of old session IDs, and thus no 
confusion about which session a given session ID refers to.
 
> I want the first logged in client to always get session id 0.

The first session to get added to muscled should always be assigned ID zero.  
Is this not the case for you=3F

> The counter remains active after both client and server has been stopped.

I don't understand how that could be... once the server process has exited, all 
server state is destroyed (i.e. the server never saves any data to the disk, so 
there is no way it could remember the counter value).

If session IDs are a problem for you, however, you might consider "tagging" 
your session with a unique database node that would help identify it, rather 
than using the session ID as a unique identifier.  For example, your 
zeroth-client could upload a database node named "myspecialsession" in the 
database using PR=5FCOMMAND=5FSETDATA (or the server could set it by calling 
SetDataNode() from within the session class's AttachedToServer() method), and 
then the other sessions could specify this session by adding a 
PR=5FNAME=5FKEYS=3D"/*/*/myspecialsession" String field to the Messages they 
send.

Let me know if that helps,
Jeremy



Other related posts: