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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:18:06+00:00 2026-05-28T03:18:06+00:00

I have three entities: A,B and C. A is a server and B and

  • 0

I have three entities: A,B and C. A is a server and B and C are clients.
A is a multithread server implemented using the class in java.net

I would realize a communication in which B sends a message to A, A send a message to C and C send a message B.my question is: the clients C must be even a server or is must be only a client that forward the message?

public class ServerA{

public static void main(String[] args){

    boolean listening = true;
    int port_number = 8888;

    try{

        ServerSocket ss = new ServerSocket(port_number);

        System.out.println("Waiting for incoming connection...");

        while(listening){

            new Thread(new ServerThread(ss.accept())).start();

        }

    }
    catch(IOException ioe){ioe.printStackTrace();}
}
}

public class ServerThread implements Runnable{

    @Override
    public void run(){

    }

}

  • 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-28T03:18:07+00:00Added an answer on May 28, 2026 at 3:18 am

    Is there any particular reason why you would like design your architecture like that?

    To answer your question: lets think a bit about it. What do you need to send a message from client C to client B? How would you want to implement it? You mentioned a channel in your comment – but what do you exactly need to open a “channel” between two clients? You need to know somehow its (client B’s) location and a port client B is listening for messages on (worst case scenario each client knows about all/some other clients, better way would be to query the main server for a list of other clients/have some kind of a registry with all clients). Also, obviously, client B needs to have a port opened and be waiting for messages.

    So basically client C queries server A for something, gets a response and then sends (through a socket) a message to client B, which has to be listening (just like client A was) for it. This is basically what server-client does.

    If you know that it will be in a LAN or something similar then you can consider using UDP instead of TCP, but then you need to manage way more things by yourself since it is not as reliable.

    This architecture reminds me more of a peer-to-peer network (where all “clients” are more like a client+server combination) with a single server which can fetch data from somewhere/do some computation.

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

Sidebar

Related Questions

I'm using Doctrine 2 ORM and I have this problem. I have three Entities,
I have a Java server application with a ton of different entities. So far,
I've started porting a .NET SQL Server application to LINQ to Entities. I have
I have three entities: EntityA, EntityB and EntityC connected with to-many relationships. See schema
I have a case where i have three entities with one-to-many and one-to-many relationships:
I have email addresses encoded with HTML character entities. Is there anything in .NET
I have a java desktop application with information about several entities. There is a
I have three models: class ReleaseItem < ActiveRecord::Base has_many :pack_release_items has_one :pack, :through =>
We have a normalized SQL Server 2008 database designed using generic tables. So, instead
In ASP.NET MVC there is Model, View and Controller. MODEL represents entities which are

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.