Ayuda con codigo RMI
Publicado por Daniel (1 intervención) el 15/04/2017 19:51:21
Buenas tardes, necesito ayuda con un codigo de RMI ya que soy un novato total y absoluto en esto (0 conocimiento ) y un profesor nos envio una tarea la cual sin saber nada sobre RMI me es imposible hacer.
La tarea consiste en hacer funcionar el codigo que les presentare a continuacion, esta dividido en 2 partes un Servidor y un Cliente.
Servidor:
Cliente:
De verdad me gustaria contar con la ayuda de alguien y de como hacer funcionar estos codigos ( debo usar NetBeans IDE 8.2 para correrlo )
La tarea consiste en hacer funcionar el codigo que les presentare a continuacion, esta dividido en 2 partes un Servidor y un Cliente.
Servidor:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package servidor;
import java.net.InetAddress;
import java.net.InetAddress;
private int estePuerto;
private String estaIP;
private Registry registro;
public RmiServidor() throws RemoteException {
try {
} catch (Exception e) {
throw new RemoteException("No se puede obtener la direccion IP.");
}estePuerto =
ventana = new GUIServidor();
ventana.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
try {
} catch (Exception e) {
e.printStackTrace();
System.exit(1);
}
}
Cliente:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
private JLabel estado;
botonEnviar.addActionListener(this);
estado = new JLabel("Estado...");
.getText().equals("")) {
enviarMensaje(cajaEnviar.getText());
cajaEnviar.setText("");
}
}
private static void conectarseAlServidor() {
try {
}
private void enviarMensaje(String mensaje) {
estado.setText("Enviando " + mensaje + " a " + direccionServidor + ":" + puertoServidor);
try {
estado.setText("El mensaje se ha enviado!!!");
static public void main(String args[]) {
JFrame.setDefaultLookAndFeelDecorated(true);
RmiCliente ventana = new RmiCliente();
ventana.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
De verdad me gustaria contar con la ayuda de alguien y de como hacer funcionar estos codigos ( debo usar NetBeans IDE 8.2 para correrlo )
Valora esta pregunta


0