Question:

Do u have any idea how I can make this software? What do I need to know to start?

by  |  earlier

0 LIKES UnLike

It`s a very simple windows application but It should be run on a LAN.

Here is what I want to make its a kinda game:

Someone runs the application for the first time,others will join him from their own workstation (they r all on a same LAN) So now they r all running the application at the same time, every one enters a number ,and after they all entered their numbers the application gives the sum of numbers.

 Tags:

   Report

1 ANSWERS


  1. I am assuming you already know how to program in whatever language you want to use to make this program and just are confused about how to structure the program. If you don't know how to program, stop here and go find a tutorial or book on programming.... C# is a good language to learn and allows one to easily make windows programs.

    You must have a server to listen to a particular port. I would pass the connection off to another thread so the server could go back to listening for more connections. This will allows multiple users to connect at the same time. You must make sure the server program keeps a list or array or some way to keep track of all of the users connected so it can contact them. You must alway create a way to track if they have sent in a number from the user.

    Then you have all of the users connect to that user's computer (use a TCP/IP connection) using a client program you create. That program will connect to the server, take the user's input, pass the input to the server, then output the sum. Since this is on a small lan, I doubt you need it, but it might be nice to for the server to output which users have or have not sent in data every time the server recieves data. This would help the users track who they are waiting on. As I said, that wouldn't be necessary, but it wouldn't be hard to implement.

    The server would keep track of which of the connections have sent in their user's number. After all numbers have been received, add the numbers and send the result back through each of the connections. The client would wait for this response and then print out something like, "the sum of all the numbers is: x" and just put in the number recieved as x.

    Depending on how you want the program to run, you can have the server close all of the connections and consider the game done, or you can just have the server reset whatever list you use to track which connection have sent their number to a value to show none of them have sent a number and wait for each client to send a number again.

    You may want to plan how/what data is sent before you start coding... create a list of info that you might need such a the client informing the server that it is leaving (so the server will take any necessary actions such as take the client off the list of computers it is waiting for a number). If you are not having the program automatically end after all the clients receive the first sum, you may want to do something like periodically have the server send out another message (determine this before you start coding) to each of the clients and have the client send a message back to confirm that it is still there and client's system did not have some kind of error/crash and make the server wait an eternity for a number that isn't coming. If the client does not respond, then take it off the server's list. This may be more work than is necessary for your purposes, but it is an idea.

Question Stats

Latest activity: earlier.
This question has 1 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.
Unanswered Questions