Seperate Consoles for Client and Server (Java RMI)
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 calledDesired 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.
精彩评论