Interactions between two separate programs?
I'm writing a scoring program for a middle school quiz bowl tournament and have a few questions. Basically I have two separate Java programs (both completely functional). The first is for a match (there are many matches in one tournament) and keeps track of the scores during the match. It is projected during the matches so the audience can see the current scores. The second program keeps track of all the scores for each of the matches that have been played / are being played. It is projected in the lobby as a sort of digital bracket system. Currently, the scoring program for the match sends an email at the end of the match to a specified address. Then the person in the lobby checks that email address and updates the bracket. Multiple matches are being played at any given time and there is occasionally more than one bracket (too many teams sign up for the tournament so two brackets are created).
I'm trying to figure out if there is some way I could connect the two programs and have the bracket automatically update every time a match is completed. Is this possible? Any suggestions?
Also, is there a way that multiple computers could access these programs at the same time without having to download the program to each computer and without the programs conflicting? I was thinking I might be able to change them to applets, but I'm unsure if that would help.
I'm still somewhat new to Java programming (a little under a year of experience) and could really use the help. Thank you so much for any and all assistance :)-:
Re: Interactions between two separate programs?
Several ways, depending upon criteria.
Sockets: Lesson: All About Sockets (The Java™ Tutorials > Custom Networking)
RMI: Trail: RMI (The Java™ Tutorials)
If you are on the same machine and one instance controls the other, then Runtime.exec could also be used using IO.
Based upon the info you provided, my guess would be that sockets might be the way to go.
Re: Interactions between two separate programs?
Awesome! Thank you so much =]
Re: Interactions between two separate programs?
I added the Socket related classes and the programs run and interact wonderfully on my own computer. However, when I run either one of the programs on a different computer, the client program (match scoring program) can't find the host computer to update the bracket. I'm pretty sure I have the correct name for the host computer. What else could cause this to happen? Could it be because I am on a public network rather than a private/home network?