Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » Newbie corner » Multiple users over LAN
Multiple users over LAN [message #30416] Wed, 29 December 2010 16:11 Go to next message
demynted is currently offline  demynted
Messages: 1
Registered: December 2010
Junior Member
I am playing around and trying to enhance my programming understanding and skills. I have the basics down cold and have some semi-complex programs I've made in the past. But now I am experimenting with a program that will allow multiple users to be in at the same time. I'm not sure how to accomplish this.

In my scenario, I have a small company and am making a simple program to authorize them to take breaks. So far, I have an employee class with two data members, String empName and bool isOut. I already have the GUI down. The rules are that only 4 people can be out at a time. But the part that is giving me the most trouble is figuring out how they all can run the program from different workstations and have access to the same information. Currently, when I run the program from 2 different workstations, they each only show themselves. I've searched many different tutorials but am not finding what I'm looking for. Any help would be appreciated!
Re: Multiple users over LAN [message #30423 is a reply to message #30416] Thu, 30 December 2010 01:04 Go to previous messageGo to next message
fudadmin is currently offline  fudadmin
Messages: 1321
Registered: November 2005
Location: Kaunas, Lithuania
Ultimate Contributor
Administrator
What about one piece of a software which serves as a server (sql ?), counting established communications with logged-on supposedly working users. The other pieces - user/client side software. Similar to, like you see here users logged onto this forum. The difference depends on imagination how a workstation or/and server reacts to >4 logoff.
e.g of ideas -
1. should lock the door... Smile
2 if the user escapes should track him with google latitude and... (your imagination)
Hope this helps.
Re: Multiple users over LAN [message #30427 is a reply to message #30416] Thu, 30 December 2010 13:05 Go to previous messageGo to next message
mr_ped is currently offline  mr_ped
Messages: 825
Registered: November 2005
Location: Czech Republic - Praha
Experienced Contributor
fudadmin: especially in case of fire emergency it's important to air-tight seal all exits and never let anyone out. Smile (joking .. hopefully)

demynted: this looks like good task for some SQL DB server, did you consider that?

You can also used shared file system to write files at the same location mapped from every workstation. (you will have less work with setup, because you don't have to install DB, but you will have to code more to properly lock/unlock the shared file during reading/updates to not corrupt it by accessing from two PCs at the same time)

Also in the end if you do install some server, maybe you can reconsider this whole app and create it as some simple PHP script on server side, so people will use it trough web browser (no hassle to install/update the app on each PC, you will have "only" to maintain the server).

If you are really adventurous, you can create the web app in U++ (as shown in examples/bazaar/reference it's possible to create some cgi server module, but it would be much more interesting for U++ community to have some full web app working to study, because current source available is mere proof of concept, nothing more Smile ).
Re: Multiple users over LAN [message #30428 is a reply to message #30416] Thu, 30 December 2010 13:07 Go to previous message
mr_ped is currently offline  mr_ped
Messages: 825
Registered: November 2005
Location: Czech Republic - Praha
Experienced Contributor
BTW, if you don't want to really bother with some big DB, you may try SQLite file database on shared network folder.

I'm not SQLite guru to say for sure this is reasonable approach, but if you do a quick check over sqlite docs, you will probably find there some recommendations if such usage pattern is desired and if sqlite will take the burden of locking/synchronizing files from you, so you can focus on app code and use just SQL API to read/write data.
Previous Topic: FullScreen: why does not work?
Next Topic: error C2110: '+' : cannot add two pointers
Goto Forum:
  


Current Time: Thu Mar 28 17:37:53 CET 2024

Total time taken to generate the page: 0.01786 seconds