Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to limit the max # of connected users ?
Message
From
02/06/1998 15:09:06
 
 
To
02/06/1998 13:39:25
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00104087
Message ID:
00104149
Views:
22
Hi Adam,

> [...]Basically, you want the network to handle the problem. Because if you have it as stored data than a crash will leave you with an incorrect user count.
>So:
>1. Create a subdirectory of your data subdirectory.
>2. In mainline logic, add a program that checks for the existance of the file DUMMY.001. It checks to see if DUMMY.001 is open by attempting to open it exclusively with FOpen(). If it does not exist it is created. A dummy byte or two is written to it and it is closed. We try to open DUMMY.001 and leave it open for the duration of the program. If DUMMY.001 is already open we do all this with DUMMY.002. We can do this until DUMMY.XXX Where XXX = the maximum permissable number of users.

I'm with you about the possible incorrect user count for data stored in the database, but I see no difference in the main idea behind these two ways. You open a file, and that's exactly like adding a record or setting to true a field. The problem, again, is : if one client crashes, who deletes the DUMMY.XXX file where XXX = the number related to the crashed client ??

>
>This may sound psychotically ugly, but the information will remain correct as long as the server successfully tracks what files are open. And shutting down the server should fix any weird problems...

Weird problems ??
Sincerely,

Andrea Brajuka
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform