client:
Socket sc = new Socket("127.0.0.1",6002);
DataInputStream in =null;
DataOutputStream out = null;
in = new DataInputStream(sc.getInputStream());
out = new DataOutputStream(sc.getOutputStream());
out.writeUTF("FddFF");
server:
public void RemoteServer() throws Exception{
RunJFrame runFrame = new RunJFrame();
ServerSocket server = null;
Socket you = null;
DataInputStream in =null;
server = new ServerSocket(6002);
//DataOutputStream out = null;
you = server.accept();
in = new DataInputStream(you.getInputStream());
//out = new DataOutputStream(you.getOutputStream());
String ss = in.readUTF();
System.out.println(ss);
if(ss.equals("aa")){
runFrame.setVisible(true);
}
in.close();
you.close();
server.close();
}