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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T13:56:00+00:00 2026-06-04T13:56:00+00:00

There are three classes: Server, Client, Test. I need to run server which waits

  • 0

There are three classes: Server, Client, Test. I need to run server which waits for client and process it’s commands. While trying to run two classes within Test it ends up in server’s while (wait cycle for client connection on a socket):

class Test{
    new Server();
    new Client();
}

How to run and debug this kind of application?

  • 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-04T13:56:02+00:00Added an answer on June 4, 2026 at 1:56 pm

    You can just create two Threads like this:

    Thread serverThread = new Thread(new Runnable() {
      @Override
      public void run() {
        new Server();
      }
    });
    Thread clientThread = new Thread(new Runnable() {
      @Override
      public void run() {
        new Client();
      }
    });
    serverThread.start();
    clientThread.start();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to run some validation tests on our c# client-server configuration. Is there
Hello there im trying to send files using client-server classes in java. For some
I have three classes, the client, the server and the handler (which is going
There are three Timer classes that I am aware of, System.Threading.Timer , System.Timers.Timer ,
I have three classes: ClassA , ClassB , ClassC . ClassC extends ClassB which
I have three classes: Client Session Socket Both Session & Socket depeand on the
Well I want to send commands and data between client and server. I have
I have a server application and two Swing-based client applications. We're developing them in
I'm trying to design a server/client architecture, and I'd wanted to ping you guys
I am writing (trying) a client server application with these 3 layers: Client and

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.