Sequence Number generator on the server

K

Kamran K

Hello
I have created a client server application using C#. Existing
application is using random number on client side to generate sequence
numbers that are then assigned to transactions. This results in
duplicate sequence numbers across multiple users.

Solution to this problem is to generate the sequence number on the
server. Since this is not an ASP app, I cannot use Global.asax
Application object to keep track of begin application.

I would like to do this without hitting the database or use file system
to store and read numbers.

I would appreciate if anyone can help me with creating a sequence number
generator that would not result in duplicate numbers across multiple
users.

Thank You
 
J

Justin Rogers

You can send the client a set of numbers to use (Lease) for transactional
purposes
and they can run through them. They can get new numbers as they need them. Are
these being used to identify connections? If so, then there are a number of
security
holes with your design. The transaction ID's can be modified by a simple client
ID
that is assigned at the server level. That way client's can issue a normal 16
bit ID,
you assign an additional 16 bits based on a client ID and that generates a new
unique
transaction ID. The client doesn't even need to know it's client ID because that
information
is associated with the socket on the server side.

You mention not using ASP, so this should be really easy in a socket based
application.
 
N

news.microsoft.com

Could you use GUIDS?

They were designed to provide the functionality you need.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top