Implementation of the Client-Server Architecture : Push, using Remote Method Invocation.
-
Execute
Server.java -
When "Server's ready", execute
Client.java, and enter a username. -
Then, execute
Client2.java, and enter a username for the second Client. -
Next, in the command line terminal of Client or Client2, inform the receiver receiver and your message.
-
Finally, the receiver receives the message from the emitter in its command line terminal.
- Two users cannot have the same nickname.
- User can send a message to himself.
- All information is printed on server-side.
Clientapps own a reception component :ReceiverImpl, that enableServerapp to send them immediately received messages (instant messaging).Reception components also provide functions that enable
Serverapp to push to clients the list of connected clients (initClientsfunction) then to update this list (addClientandremClientfunctions).Reception component
ReceiverImplreferences are provided toServerapp thanks to an input parameter (Receiver) of the connect function of the server’sConnectioncomponent. This function returns a reference of theEmittercomponent that is instantiated to be used by the client to send messages to theServer(and that incidentally represents the client app on the server).Sylvain VAUTTIER, IMT Mines Alès.