Java - Ayuda con codigo RMI

 
Vista:

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:

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
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder
sin imagen de perfil

Ayuda con codigo RMI

Publicado por Jordi (135 intervenciones) el 16/04/2017 02:35:12
Yo encantado te ayudaría pero no tengo el nivel suficiente .
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar