Det er også fair nok... Det er jo bare rart du vil hjælpe... så det er jeg da taknemlig for... Der bliver også lige fyret op på pointsne...
Poster lige koden for min Client, så kan et være Arne_v kan give lidt indput også...
_____________________________________________________________________________________
package rmi;
import java.rmi.*;
import java.io.*;
import java.io.BufferedReader;
public class RMI_Client
{
public static void main( String args[] ) throws Exception
{
// Host Args
if (args.length != 1)
{
System.out.println("Syntax - Gues it Jackass!!");
System.exit(1);
}
// Assining black hole secure
if (System.getSecurityManager() == null)
{
System.setSecurityManager( new RMISecurityManager() );
}
// Call some shitty interface
RMI_Serv_Interface service = (RMI_Serv_Interface) Naming.lookup("
rmi://" + args[0] + "/RMI_Serv");
BufferedReader din = new BufferedReader( new InputStreamReader(System.in) );
//DataInputStream din = new DataInputStream(System.in);
while(true)
{
System.out.println("1 - Turn on LED");
System.out.println("2 - Turn of LED");
System.out.println("3 - Get led Status");
System.out.println("4 - Shut the shit down");
//String line = din.readLine();
String line = din.readLine();
Integer pick = new Integer(line);
int val = pick.intValue();
switch (val)
{
case 1:
if (service.getLedStatus() == true)
{
System.out.println("Man you are stupid, the LED is already on.");
} else
{
service.setLedStatus(true);
System.out.println("You have turned on the LED, do you realle think thats a good idea?");
}
break;
case 2:
if (service.getLedStatus() == false)
{
System.out.println("Man you are stupid, the LED is already off.");
} else
{
service.setLedStatus(true);
System.out.println("You have turned off the LED, now we can save some power, Jubii!!!");
}
break;
case 3:
System.out.println("Are you completely blind? can't u se for your self?");
System.out.println("Ohh well the led Status is: " + service.getLedStatus());
break;
case 4:
System.exit(0);
break;
default:
System.out.println("Are you retarded or somthing, thats not even a choice!");
break;
}
}
}
}