chat rmi server/client and peer2peer

This commit is contained in:
2014-12-10 01:49:28 +01:00
parent 4d3128b724
commit b01bc963c8
11 changed files with 394 additions and 0 deletions

31
rmi_chat/Client.java Normal file
View File

@@ -0,0 +1,31 @@
package rmi_chat;
import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;
/**
* Created by Giovanni on 10/12/2014.
*/
public class Client extends UnicastRemoteObject implements ClientInterface {
public Client () throws RemoteException {
}
@Override
public void spoken(Message m) throws RemoteException {
System.out.println(m.getFrom() +" : " + m.getM());
}
@Override
public void bye(String to) throws RemoteException {
System.out.println(to + " has quit");
}
@Override
public void welcome(String to) throws RemoteException {
System.out.println(to + " has joined");
}
}