开发者

Seperate Consoles for Client and Server (Java RMI)

开发者 https://www.devze.com 2023-02-24 09:17 出处:网络
I am writing a client-server application using Java RMI. Now, my question is I have multiple clients and a server, to see some communication, I have System.out.println statements (SOPs) in both clien

I am writing a client-server application using Java RMI.

Now, my question is I have multiple clients and a server, to see some communication, I have System.out.println statements (SOPs) in both clien开发者_StackOverflowt and servers, but I see all the outputs on just one console, is there a way to view them separately?

To clarify it further let me give you a simple example,

**Server**
void callServer(){
System.out.println("Server is called");
}


**Client**
void callClient(){
System.out.println("Client is called");
server.callServer();
}


**Simulator**  
main(){ 
//create RegistryServer
//create server instance
//create client instance
System.out.println("Sim Started");
client.callClient();
}

OUTPUT of Sim

Sim Started

Client is called

Server is called

Desired Output

Sim Console: Sim Started

Client Console: Client is called

Server Console: Server is called

Is it possible?


Do you have the client and server separated in different applications or are you running them both from one. If you have them separated you can just run them each in separate terminals and writing to standard out would print the output of each application to its own terminal.

0

精彩评论

暂无评论...
验证码 换一张
取 消