/* * Test file to toggle led in the siteplayer * */ import java.io.*; import java.net.*; class toggle { public static void main(String args[]) { Socket sock = null; DataInputStream dis = null; PrintWriter dat = null; try { sock = new Socket("192.168.0.17", 80); } catch (UnknownHostException e) {} catch (IOException io) {} try { dis = new DataInputStream(sock.getInputStream()); dat = new PrintWriter(sock.getOutputStream()); dat.flush(); for(int i=0; i<5; i++) { dat.println("GET /factory.spi?io3=0"); dat.flush(); try { Thread.sleep(1000); } catch (InterruptedException interrupted) {} dat.println("GET /factory.spi?io3=1"); dat.flush(); try { Thread.sleep(1000); } catch (InterruptedException interrupted1) {} } sock.close(); dis.close(); dat.close(); } catch (IOException ioe) {} } }