| Author |
Urgently Help/Guidance Required
|
Vrishal Likhite
Greenhorn
Joined: Nov 21, 2005
Posts: 18
|
|
The programme is in Rmi, i want an ordered list of hostnames in a multicast group.The PROBLEM is that i want to receive the server name on client and send client name to the server i am sendin my rmi implimentation file please take a look.... public void send() throws RemoteException { try {//**************************************** //used to get the computer name //**************************************** InetAddress address; address=InetAddress.getLocalHost(); String name=address.getHostName(); System.out.println("name="+name); //***************************************** //Building socket to send the name //**************************************** MulticastSocket socket=new MulticastSocket(6000); DatagramPacket packet; byte buffer[] = new byte[256]; address=InetAddress.getByName("230.0.0.1"); packet= new DatagramPacket(buffer, buffer.length,address, 9013); socket.send(packet); System.out.println("Name Sent"); //**************************************** } catch(Exception e) { System.out.println("error in data send"); } } public void receive()throws RemoteException { try { InetAddress address= InetAddress.getByName("230.0.0.1"); MulticastSocket socket; DatagramPacket packet; byte buffer[] = new byte[256]; System.out.println("in receive"); //*************************************** //Receive the names of others //**************************************** String data="No data"; socket= new MulticastSocket(9013); packet =new DatagramPacket(buffer, buffer.length); socket.joinGroup(address); System.out.println("group joined"); socket.receive(packet); data=new String(packet.getData()); System.out.println("The Recieved Data =="+data); } catch(Exception e) { System.out.println("error in data receive"); } } } Am stuck up in this part of code above and urgent answer is expected. thanking you in advance vrishal
|
 |
 |
|
|
subject: Urgently Help/Guidance Required
|
|
|