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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T07:16:04+00:00 2026-06-12T07:16:04+00:00

I have two java applications, one is web app and another is simple java

  • 0

I have two java applications, one is web app and another is simple java app, So I am using Socket programming for communication between them.

I made one SocketServer which is a Thread, in which I created ServerSocket serverSocket = new ServerSocket(6789)
And in my web app I created Socket client = new Socket("localhost", 6789);
My server sends some data to client and client will start some other work, but if I want to run another client i.e. server will send different parameters and client have to start processing what should I do?

Because server is already started on ‘6789’ port and first client also with the same port. How can I start client with another port?

Every time Server must have to started first and then client.

I think client will not found server till both are having same ports.

Am I have to create another server instance with different port and then invoke client??? But How can my client will know on which port server is started?

For Example:

Imagine I have UI like:

start MIlind

start xyz

start abc

and click on strart it will call client and start process, If an start Milind first then How will I start xyz?
because ‘start Milind’ started client and server at port 6789, How will other start process works?

  • 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-12T07:16:05+00:00Added an answer on June 12, 2026 at 7:16 am

    It seems like a lot of overhead to create a server/client app just for a web app to communicate with a local java program (and even more so to duplicate this process to do more than one thing at a time). If you are looking for concurrent processing in the background of a web app, you can always just create a thread (or multiple threads) to do the work. Or is there a reason why the simple java app can’t be embedded in the web app?

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

Sidebar

Related Questions

I have two separated applications, one written in Java and other in Erlang. Both
We have a couple of Java Web applications that serve different purposes (one for
I have two separate web applications, both in the same intranet. One of the
I have two web applications (bot of them ear files) deployed on the weblogic
I have two web applications hosted on a server. From one I am trying
I have two Java applications in my network that talk to each other over
I have two Java interfaces and one implementing class. (I have used Eclipse to
I am using struts, I have a java web application which needs to run
In one of my Java 6 applications I have a thread that feeds the
We have a web application with load balancing in two machines with a java

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.