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 8554487
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T14:53:37+00:00 2026-06-11T14:53:37+00:00

I need to write an application in java which communicates with a web server.

  • 0

I need to write an application in java which communicates with a web server.
I know how to do that, using PHP, but I’m afraid it won’t cut it in this one.

Here’s my situation.
I have multiple clients, when one of them sends a specific message to the server (so far, no problem on PHP), I want it to send a certain message to all other connected clients.
The problem is, I could hardly find any information regarding server socket in PHP, which led me to believe this isn’t the proper way of achieving that. I’m using a paid hosting (x10premium) to host my servers so far, so I was thinking of doing it with this one, however, I’m not sure it’s even possible with PHP.
At the moment I’m having each of the clients periodically check with the server if he received a message from any of the other clients, but I don’t like this solution…
I hope someone could point me to the right direction. I don’t know too much about Ruby and other languages which are used to do stuff like that, But if necessary, I would gladly learn it.

Thanks in advance

EDIT:
Forgot to mention, the server (currently the PHP) would also communicate with a MySQL table. If it matters.

  • 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-06-11T14:53:38+00:00Added an answer on June 11, 2026 at 2:53 pm

    This is a good example of PHP socket server/client:
    http://tech.navarr.me/2010/07/how-to-create-a-socket-server-in-php.html

    You could do it just like with JAVA, but remember that PHP does not support multithreading or multiprocessing so if 10 clients connect at once to your server, you will process them one by one, so eventually 1 will have to wait for the other 9 to finish – everything, database and connection overhead.

    If you do it with JAVA or Python for example, you could handle each request in separate thread so that DB & Network communication overhead is handled simultaneosly.

    Python has build in socket server components and nice and easy to use mysql component, that would make it a breez to achieve this, without even having to understand threading at all.

    For the python socket server see here:

    http://docs.python.org/library/socketserver.html

    Basically you just define a function that will be executed for each new client connection and tell the server to serve_forever() – until it dies, it will do what you want.

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

Sidebar

Related Questions

I need to write a java application which can merge docx files. Any suggestions?
I need to write a standalone Java application which will have a embedded HTTP
I need to write a MultiThreaded Java Application that will be used to load
I need to build Android application using Java which is able to send request
I need to write a Java client application which, when given the below URL,
Usually I develop in Java but now I need to write an app that
I need to write some kind of client-server application using bluetooth. I need to
I'm working on a Java-based web app using Tomcat 7.0 as the application server.
I need to write cross platform application (basically CRUD). Is usage of Java Swing
I need to write a stress tester for an application I've developed. Java is

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.