Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6052425
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T07:55:38+00:00 2026-05-23T07:55:38+00:00

I’ve been trying to work out how to approach this problem but I don’t

  • 0

I’ve been trying to work out how to approach this problem but I don’t know where to start.

I have an game applet written in Java that I’m trying to make multi-player across a network. At the moment it is a standalone application but eventually it needs to be on some sort of web page where clients can access it through a browser and play against each other.

I was thinking that each clients applet could communicate using sockets with an applet that runs constantly on a tomcat server. This applet on the server would handle incoming socket connections, create new threads to handle each connection, maintain a list of connected clients, and set up games. Clients could also get information from a database about past games etc. by communicating with the server.

For example I want a client to be able to start a game. Then other clients are notified that he has started a game and can join the game. Then when the host clicks start game, all the other clients are notified and the game begins in their applet. Whoever solves the puzzle first would then click finished. His score would be sent to the server applet which then forwards the result to each client connected.

So i have some questions

  1. Does this sound like a reasonable plan?

  2. How does tomcat assist with this?

  3. How would i deploy it to tomcat? I’m doing this in eclipse and have set added a local tomcat server. Do i just run the class on the server with eclipse, then socket connect to http://localhost/packagename/classname on the applet?

  4. What classes would the servlet need to extend to make it connectable? Since connections will be made from an applet should the servlet be a Non-Http Servlet?

  5. Can you recommend some documentation or provide some example code of a client applet communicating with a server applet using tomcat? All the examples I’ve seen are just html forms that pass information to a servlet using Http.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T07:55:39+00:00Added an answer on May 23, 2026 at 7:55 am

    If your application doesn’t need real-time communication with a server over a raw socket (and it sounds like yours does not), you might be better off using standard web protocols for your applet to communicate with the server.

    One choice might be HTTP/JSON. Your applet could make an HTTP connection to a servlet, and that servlet will generate a JSON object that represents a message the server wants to send to the client. The client will start a thread that will loop, making an asynchronous blocking call to your servlet to poll for new data.

    The major advantage of this approach, is that in the future, should you be so inclined, you can ditch the client-side java applet, and replace it with HTML5 and Javascript.

    GSON is a library to use for JSON serialization/deserialization. And java.net.URL is what you would use to connect to the servlet inside your applet.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a jquery bug and I've been looking for hours now, I can't
this is what i have right now Drawing an RSS feed into the php,
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
Does anyone know how can I replace this 2 symbol below from the string
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I have this code to decode numeric html entities to the UTF8 equivalent character.
I am trying to loop through a bunch of documents I have to put

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.