Unique Remote thread/context ID
-
Hi, I want to write a centralised session server that runs as an SAO for remote access. This will essentially be a dictionary for session objects keyed by a unique identifier (based on the 'Virtual Singleton' pattern). My problem is : what should I use as the unique identifier -- it must be unique to the program instance running on the network. I initailly thought of the remoting context as the key, but I'm not sure that is the best way (are context's unique accross the whole network, or only to each PC?). Is there some combination of AppDomain property and thread property that is unique accross a network? TIA Dr Herbie. Remember, half the people out there have below average IQs.
-
Hi, I want to write a centralised session server that runs as an SAO for remote access. This will essentially be a dictionary for session objects keyed by a unique identifier (based on the 'Virtual Singleton' pattern). My problem is : what should I use as the unique identifier -- it must be unique to the program instance running on the network. I initailly thought of the remoting context as the key, but I'm not sure that is the best way (are context's unique accross the whole network, or only to each PC?). Is there some combination of AppDomain property and thread property that is unique accross a network? TIA Dr Herbie. Remember, half the people out there have below average IQs.
GUIDs are unique. Will they do?
Guid x = Guid.NewGuid();
From MSDN Library: GUID represents a globally unique identifier. A GUID is a 128-bit integer (16 bytes) that can be used across all computers and networks wherever a unique identifier is required. Such an identifier has a very low probability of being duplicated. -
GUIDs are unique. Will they do?
Guid x = Guid.NewGuid();
From MSDN Library: GUID represents a globally unique identifier. A GUID is a 128-bit integer (16 bytes) that can be used across all computers and networks wherever a unique identifier is required. Such an identifier has a very low probability of being duplicated.Arjan Einbu wrote: GUIDs are unique. Will they do? My intent for this design is to remove any explicit token passing. I already have a session object which has to be passed accross to the remote object to identify the user. I wanted to avoid having to explicitly pass any extra variables, so I was hoping that the thread/context/appdomain might contain something I could use to uniquely identify the client. E.g. Instead of:
public void SAO:PerformAction(token ClientIdentifier, int parameter) { CheckSecurity(ClientIdentifier); DoStuff(parameter); }
I could do:public void SAO:PerformAction(int parameter) { CheckSecurity( GetUniqueTokenFromCallersContext() ); DoStuff(parameter); }
I'm trying to make the remoting interfaces as seamless as possible and I personally hate having to have an identifier token passed to every SAO method. X| Maybe I'm hoping for too much. :sigh: Dr Herbie. Remember, half the people out there have below average IQs.